Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

OSB Forcing rollbacks for transaction  RSS feed

Sander Evanfield
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'am a newbie to OSB and have a question about (JMS + Http transport) approach.

I have a requirement to read a message from a JMS queue (XA) and route (sync) to a business service which is wrapper for a SOAP service.

Our architecture grp forbade us from using service callouts due to high loads and do not want to have any performance issues.

For all service server side exceptions related to 500, 404 what should be our approach to handling exceptions and transactions

considering reqd is not to lose any messages (Message should go back on JMS Queue during a exception like 404 or 500)

Since http transport cannot be part of XA we want to read the response code in the response pipeline and raise an error which will

rollback the transaction.

Scenario and its probable solution unfolds below

•request pipeline of JMS queue consumer starts transaction.

•This transaction is suspended (Best effort does not matter with exactly once since http is xa non compliant)

when call is routed to service

•Service will have to execute without any transaction context.

•Service will fail with some exception like 404 or 500

•Control will pass to the response pipeline and I want the response pipeline to continue the suspended transaction of the request pipeline

So that can be achieved by having the checkbox (same transaction for response) enabled ?

In the response pipeline we want to read response code (if expression) and for 404 and 500 raise an error and force transaction to rollback.

Can anyone provide code samples for this and also validate if the above approach works ?

Is there a better error handling mechanism in our scenario ?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!