• Post Reply Bookmark Topic Watch Topic
  • New Topic

JMS-queue handling  RSS feed

 
john randell
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I have on client which produces TextMessages to queue in WLS 8.1. In WLS, there is a pool of MDB-instances and because of that I notice that messages arrived to queue are not handled in same order than they arrive. So if I send messages in order: 1,2,3,4,5 they are handled for examples 2,3,1,4,5. Does anyone know the way to handle this?

Thank,
John
 
Osuwari Inu
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JMS is by design asynchronous so the described behaviour, although clearly not intended, is valid.
If you want the messages processed in order you would need to either build your own synchronisation mechanism, or make the individual messages part of one large message.

Think about it this way: you have five message processors and you want all of them to wait until the messages prior to that particular one have been processed. Sounds like sequential processing to me.
 
kri shan
Ranch Hand
Posts: 1487
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can i build own synchronisation mechanism ? Any inputs ?
 
Osuwari Inu
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For the original post I would recommend rethinking the problem, and whether it really is a problem with the software or the chain of thought.

With a basic receive reply where one sends a message and needs to wait for a reply, I recommend listening with timeout (without is dangerous) for a reply, using the id of the request message as the JMSCorrelationID in a message selector. This works fine for us.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!