@NoImplement @MinMuleVersion(value="4.5.0") public interface Chain
Chain allows a given Operation to receive a chain of message processors to be executed as part
of the operation's execution.
When executing the Chain, all its inner components will be executed in the order declared by the user, using the output
of one processor as the input of the next one in the Chain. The execution of the Chain is completed either when
all the components were invoked successfully or when an error occurs in one processor, and it is propagated to the
Chain
| Modifier and Type | Method and Description |
|---|---|
void |
process(Consumer<Result> onSuccess,
BiConsumer<Throwable,Result> onError)
Executes the chain of components starting with the same input message that it's container scope received.
|
void |
process(Object payload,
Object attributes,
Consumer<Result> onSuccess,
BiConsumer<Throwable,Result> onError)
Executes the chain of components starting with the given
payload and attributes as Message. |
void |
process(Result input,
Consumer<Result> onSuccess,
BiConsumer<Throwable,Result> onError)
Executes the chain of components starting with the given
Result data as input Message. |
void process(Consumer<Result> onSuccess, BiConsumer<Throwable,Result> onError)
onSuccess callback will be invoked with the output Result of the last component in the Chain if no
error occurred after all the components were executed exactly once.
onError callback will be invoked with the exception propagated by the first failing component, along with the last
output Result available. The given Result will be the same that was used as input of the failing component.
void process(Object payload, Object attributes, Consumer<Result> onSuccess, BiConsumer<Throwable,Result> onError)
payload and attributes as Message.
onSuccess callback will be invoked with the output Result of the last component in the Chain if no
error occurred after all the components were executed exactly once.
onError callback will be invoked with the exception propagated by the first failing component, along with the last
output Result available. The given Result will be the same that was used as input of the failing component.
void process(Result input, Consumer<Result> onSuccess, BiConsumer<Throwable,Result> onError)
Result data as input Message. This method should be
used whenever the input of this Chain is the output of another component execution.
onSuccess callback will be invoked with the output Result of the last component in the Chain if no
error occurred after all the components were executed exactly once.
onError callback will be invoked with the exception propagated by the first failing component, along with the last
output Result available. The given Result will be the same that was used as input of the failing component.
Copyright © 2022. All rights reserved.