Method Detail

onEachOperator

Add a Publisher operator interceptor for each operator created
(Flux or Mono). The passed function is applied to the original
operator Publisher and can return a different Publisher,
on the condition that it generically maintains the same data type as the original.
Use of the Flux/Mono APIs is discouraged as it will recursively
call this hook, leading to StackOverflowError.

Note that sub-hooks are cumulative, but invoking this method twice with the same instance
(or any instance that has the same `toString`) will result in only a single instance
being applied. See onEachOperator(String, Function) for a variant that
allows you to name the sub-hooks (and thus replace them or remove them individually
later on). Can be fully reset via resetOnEachOperator().

This pointcut function cannot make use of Flux, Mono or
ParallelFlux APIs as it would lead to a recursive call to the hook: the
operator calls would effectively invoke onEachOperator from onEachOperator.

Parameters:

onEachOperator - the sub-hook: a function to intercept each operation call
(e.g. map (fn) and map(fn2) in flux.map(fn).map(fn2).subscribe())

onEachOperator

Add or replace a named Publisher operator interceptor for each operator created
(Flux or Mono). The passed function is applied to the original
operator Publisher and can return a different Publisher,
on the condition that it generically maintains the same data type as the original.
Use of the Flux/Mono APIs is discouraged as it will recursively
call this hook, leading to StackOverflowError.

Note that sub-hooks are cumulative. Invoking this method twice with the same key will
replace the old sub-hook with that name, but keep the execution order (eg. A-h1, B-h2,
A-h3 will keep A-B execution order, leading to hooks h3 then h2 being executed).
Removing a particular key using resetOnEachOperator(String) then adding it
back will result in the execution order changing (the later sub-hook being executed
last). Can be fully reset via resetOnEachOperator().

This pointcut function cannot make use of Flux, Mono or
ParallelFlux APIs as it would lead to a recursive call to the hook: the
operator calls would effectively invoke onEachOperator from onEachOperator.

Parameters:

key - the key for the sub-hook to add/replace

onEachOperator - the sub-hook: a function to intercept each operation call
(e.g. map (fn) and map(fn2) in flux.map(fn).map(fn2).subscribe())

onLastOperator

Add a Publisher operator interceptor for the last operator created
in every flow (Flux or Mono). The passed function is applied
to the original operator Publisher and can return a different Publisher,
on the condition that it generically maintains the same data type as the original.

Note that sub-hooks are cumulative, but invoking this method twice with the same
instance (or any instance that has the same `toString`) will result in only a single
instance being applied. See onLastOperator(String, Function) for a variant
that allows you to name the sub-hooks (and thus replace them or remove them individually
later on). Can be fully reset via resetOnLastOperator().

This pointcut function cannot make use of Flux, Mono or
ParallelFlux APIs as it would lead to a recursive call to the hook: the
operator calls would effectively invoke onEachOperator from onEachOperator.

Parameters:

onLastOperator - the sub-hook: a function to intercept last operation call
(e.g. map(fn2) in flux.map(fn).map(fn2).subscribe())

onLastOperator

Add or replace a named Publisher operator interceptor for the last operator created
in every flow (Flux or Mono). The passed function is applied
to the original operator Publisher and can return a different Publisher,
on the condition that it generically maintains the same data type as the original.
Use of the Flux/Mono APIs is discouraged as it will recursively
call this hook, leading to StackOverflowError.

Note that sub-hooks are cumulative. Invoking this method twice with the same key will
replace the old sub-hook with that name, but keep the execution order (eg. A-h1, B-h2,
A-h3 will keep A-B execution order, leading to hooks h3 then h2 being executed).
Removing a particular key using resetOnLastOperator(String) then adding it
back will result in the execution order changing (the later sub-hook being executed
last). Can be fully reset via resetOnLastOperator().

This pointcut function cannot make use of Flux, Mono or
ParallelFlux APIs as it would lead to a recursive call to the hook: the
operator calls would effectively invoke onEachOperator from onEachOperator.

Parameters:

key - the key for the sub-hook to add/replace

onLastOperator - the sub-hook: a function to intercept last operation call
(e.g. map(fn2) in flux.map(fn).map(fn2).subscribe())

onOperatorDebug

public static void onOperatorDebug()

Enable operator stack recorder that captures a declaration stack whenever an
operator is instantiated. When errors are observed later on, they will be
enriched with a Suppressed Exception detailing the original assembly line stack.
Must be called before producers (e.g. Flux.map, Mono.fromCallable) are actually
called to intercept the right stack information.

onOperatorError

Add a custom error mapping, overriding the default one. Custom mapping can be an
accumulation of several sub-hooks each subsequently added via this method.

Note that sub-hooks are cumulative, but invoking this method twice with the same
instance (or any instance that has the same `toString`) will result in only a single
instance being applied. See onOperatorError(String, BiFunction) for a variant
that allows you to name the sub-hooks (and thus replace them or remove them individually
later on). Can be fully reset via resetOnOperatorError().

For reference, the default mapping is to unwrap the exception and, if the second
parameter is another exception, to add it to the first as suppressed.

Parameters:

onOperatorError - an operator error BiFunction mapper, returning an arbitrary exception
given the failure and optionally some original context (data or error).

onOperatorError

Add or replace a named custom error mapping, overriding the default one. Custom
mapping can be an accumulation of several sub-hooks each subsequently added via this
method.

Note that invoking this method twice with the same key will replace the old sub-hook
with that name, but keep the execution order (eg. A-h1, B-h2, A-h3 will keep A-B
execution order, leading to hooks h3 then h2 being executed). Removing a particular
key using resetOnOperatorError(String) then adding it back will result in
the execution order changing (the later sub-hook being executed last).
Can be fully reset via resetOnOperatorError().

For reference, the default mapping is to unwrap the exception and, if the second
parameter is another exception, to add it to the first as a suppressed.

Parameters:

key - the key for the sub-hook to add/replace

onOperatorError - an operator error BiFunction mapper, returning an arbitrary exception
given the failure and optionally some original context (data or error).