Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Message handling in a process (JMS)

913420Jan 26 2012
Hi all

First of all, I'm a JMS noob. I used to use EAI-tools to accomplish integration assignments but now a customer wants to develop message flow, mapping, routing, etc with code:(
Because of that I got couple of questions.

A queue will contain messages from a party. Those messages are of one format but they will be processed differently depending on the values in some elements. One message may be routed directly to a system but the other may be used as a part of a process.
That process is following:
1. Pick the message from the queue
2. Use some details from the message to create a SOAP request
3. receive the SOAP response
4. create another SOAP request to update a salary system
5. When all the above steps are finished then I use the original message from 1. to update a third system

My question is if I pick the message from the queue (1.) and the process fails before its finalized (5.) then the original message (1.) is lost. Should I use try/catch in my process code to resubmit the message to the queue in case of failure? Or should I create a "Runnning-state" queue that contains messages that are in this process state.
What is the normal thinking when working processes and JMS?

Kind regards
Post Details
Locked on Feb 23 2012
Added on Jan 26 2012