Search code examples
wso2clone

wso2 4.8.1 clone mediator sequential="true"


I have a process with 2 steps but I only must execute the second one when the first one finished I use clone mediator (clone sequential="true") but target 2 start execute before target one has finished. I don't understand this behavour.

Thanks in advance


Solution

  • call mediator does not wait synchronously for the response : the mediation in the first target ends its execution and the second target is executed. When a response come back in the esb, the mediation in the first target, located after call mediator, is then executed.

    If you absolutly need to wait for the response before executing the second target, you can use callout (ESB 4.8.1) or call blocking="true" (ESB 4.9.0)

    But if what you need to achieve is "service chaining" don't use clone : use send receive="MyResponseSequence". As soos as the response will come back in the ESB, it will be processed in "MyResponseSequence". You can even use call mediator without your "clone" : the mediation located after call will be executed as soon as the response arrive in the ESB (but not before !).