Returning a desired SOAP response by using JMS Adapter and Sequential Multicast in CPI.
In this blog, I describe how to return a standard soap response as defined in the sender’s wsdl by using JMS Adapter.
Scenario : The Sender provided a Wsdl (which had request and response structure defined). They needed a soap response to be sent back without waiting for all other processing steps to be completed.
Challenge faced : JMS was not on my mind initially because retrying of failed messages wasn’t mandatory in this case. I somehow couldn’t achieve this by just using a soap adapter.
So, I made use of JMS adapter (because I had to store the messages somewhere) and on creating an IFlow like below, the sender gets a 202 response and they faced an error saying “No ACK”.
Solution : So, on creating an Iflow like below, the message gets written to the JMS queue and then the desired soap response (stored in the body of content modifier) goes to the sender. [Message Exchange Pattern is set to Request Reply]. This can later be followed by the Iflow with the rest of the operations.
Since in this case, there was no need to retry failed messages, in the next Iflow which pulls data from this JMS queue, I included an exception sub-process which would catch the exception and the same is notified to the appropriate person via mail.
We can restrict the retry attempts as well if needed as mentioned in the below link provided.
PS : I would be happy to hear your feedback or suggestions and if this can be done in any other easier way.