File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes JMS Synchronous processing of select messages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "JMS Synchronous processing of select messages" Watch "JMS Synchronous processing of select messages" New topic
Author

JMS Synchronous processing of select messages

Kerry Wilson
Ranch Hand

Joined: Oct 29, 2003
Posts: 254
What is the best way to insure that select JMS messages are processed synchronously? We are receiving batches of messages that create/update the same entity and they are stepping on each other. Luckily our model is such that the messages are easily siloed. It would be nice to be able to queue messages with a key that would make them processed synchronously.

For instance, the JMS listener would receive a message, and the queue would 'freeze' any other messages with that key such that other listeners would not get them. When the listener that got the last message returns, it would first receive any messages with the same key as the last one.

Is there anything within JMS that deals with this kind of scenario?

http://www.goodercode.com
SCJP 1.4
E Armitage
Rancher

Joined: Mar 17, 2012
Posts: 892
    
    9
I don't think you are looking for synchronous delivery here. Synchronous would almost require a request/response pattern which is not what you are looking for. (If you are looking for synchronous communication then have a look at http://myadventuresincoding.wordpress.com/2011/10/15/jms-how-to-do-synchronous-messaging-with-activemq-in-scala/) which you can adapt for your JMS provider and language.

You seem to be trying to do message aggregation. Some providers provide this feature e.g Message grouping in IBM MQ (http://www.ibm.com/developerworks/websphere/library/techarticles/0602_currie/0602_currie.html) or for Camel (http://camel.apache.org/aggregator2.html)
Kerry Wilson
Ranch Hand

Joined: Oct 29, 2003
Posts: 254
Thanks! Sounds like there is nothing in the spec for this. We are using Oracle JMS, maybe they have a similar feature.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JMS Synchronous processing of select messages