Thursday, July 14, 2011

OSB - Internal Server Error JMS Transaction rollback


This blog explain how to roll back a transaction in case of internal server errors in OSB. In general, if OSB proxy service gets any incorrect(404 HTTP Response) or there is an internal server error(500 HTTP response) from the transport the transaction will not roll back and message will lost. There seem to be some ambiguity among product designers on interpreting http spec and they decided to treat any response as a success.

Scenario

JMS Queue -> OSB Proxy Service -> OSB Business Service -> Failing Service

To resolve the issues, please flow below steps in OSB proxy service.

1) In Route node of routing options make Quality of Service as ‘"Exactly Once”


2) Enabled the Same Transaction for Response in the Proxy service which was listening to the JMS queue




3) The Connection Factory used to consume message from JMS queue should be XA enable (XA connection factory).

4) In JMS proxy Route Error handler do a raise error and Reply with Failure.

5) Enable XA required property for proxy service which is listening to JMS queue


Once you make these necessary changes in proxy services. Activate changes and retest the flow. now you can observer the transaction will roll back in case of ‘Internal server Error” J