I was able to get around this issue by passing the response sequence name to the sub-sequence.
WSO2 ESB: How to make Sequence mediator wait for response before proceeding
Question
I have the following logic in my Proxy Service:
<proxy>
<inSequence>
<switch source="get-property('Action')">
<case regex="getTaskTicket">
<sequence key="CQProxy_GetTaskTicket"/>
</case>
<case regex="updateTaskTicket">
<sequence key="CQProxy_UpdateTaskTicket"/>
</case>
...
<default/>
</switch>
</inSequence>
<outSequence>
<send/>
</outSequence>
</proxy>
Now my CQProxy_UpdateTaskTicket calls another sequence:
<sequence name="CQProxy_UpdateTaskTicket">
... some logic goes here ...
<sequence key="CQProxy_GetTicketDetails"/>
... here I need to wait for response from CQProxy_GetTicketDetails
before further processing ...
</sequence>
CQProxy_GetTicketDetails is used by various other sequences and in its turn defines OUT sequence to process its response:
<sequence name="CQProxy_GetTicketDetails">
... some logic ...
<send receive="CQProxy_GetTicketDetails2">
<endpoint key="CQ"/>
</send>
</sequence>
The problem is that after CQProxy_UpdateTaskTicket sequence calls CQProxy_GetTicketDetails sub-sequence, it does not wait for response from that sub-seq but instead continues message processing. How is it possible to make CQProxy_UpdateTaskTicket wait for response before proceeding?
Solution
OTHER TIPS
You can use the Callout mediator for the blocking kind of operations within the WSO2 ESB. Instead of using the Send mediator (which is non-blocking) you can easily use callout mediator as mentioned below.