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
- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidprocess(Object payload, Object attributes, Consumer<Result> onSuccess, BiConsumer<Throwable, Result> onError) Executes the chain of components starting with the givenpayloadandattributesasMessage.voidExecutes the chain of components starting with the same input message that it's container scope received.voidExecutes the chain of components starting with the givenResultdata as inputMessage.
-
Method Details
-
process
Executes the chain of components starting with the same input message that it's container scope received.onSuccesscallback will be invoked with the outputResultof the last component in theChainif no error occurred after all the components were executed exactly once.onErrorcallback will be invoked with the exception propagated by the first failing component, along with the last outputResultavailable. The givenResultwill be the same that was used as input of the failing component. -
process
void process(Object payload, Object attributes, Consumer<Result> onSuccess, BiConsumer<Throwable, Result> onError) Executes the chain of components starting with the givenpayloadandattributesasMessage.onSuccesscallback will be invoked with the outputResultof the last component in theChainif no error occurred after all the components were executed exactly once.onErrorcallback will be invoked with the exception propagated by the first failing component, along with the last outputResultavailable. The givenResultwill be the same that was used as input of the failing component. -
process
Executes the chain of components starting with the givenResultdata as inputMessage. This method should be used whenever the input of thisChainis the output of another component execution.onSuccesscallback will be invoked with the outputResultof the last component in theChainif no error occurred after all the components were executed exactly once.onErrorcallback will be invoked with the exception propagated by the first failing component, along with the last outputResultavailable. The givenResultwill be the same that was used as input of the failing component.
-