I send a message to ESB proxy service, and I would like to get response immediately after the service receive the content and put into the message queue. That means the proxy service will send back response message before it gets processed.
WSO2 ESB provides properties as a way to control different aspects of the messages flowing through the mediation engine. They will not change the content (payload) of the message but they will be used to change the behavior of the message flowing through the ESB.
FORCE_SC_ACCEPTED is the property we could use for this purpose.
FORCE_SC_ACCEPTED
When set to true, this property forces a 202 HTTP response to the client so that it stops waiting for a response.
( 202 HTTP is for the request has been accepted for processing, but the processing has not been completed. )
We can set this property as below.
<property name="FORCE_SC_ACCEPTED" scope="axis2" value="true"/>
This property can be used in scenarios where client send a message to the ESB and ESB will store the message in a persistent store like a message store. In this scenario, client will wait until the timeout if ESB do not send any response. In this kind of scenario, we can use this property and send a 202 Accepted response to the client. Here is an example configuration where ESB store a message in a message store.
<inSequence>
<property name="FORCE_SC_ACCEPTED" scope="axis2" type="STRING" value="true"/>
<store messageStore="POInbound"/>
</inSequence>
No comments:
Post a Comment