Discussion:
Ordering of messages in case of multiple consumer
(too old to reply)
l***@hotmail.com
2006-08-30 02:35:36 UTC
Permalink
If there are multiple JMS Sessions and MessageConsumer instances consuming from the same queue, how to guarrentee the order of processing the messages? In other words, how to config the queue such that only one MessageConsumer is active at one time? Thanks.
Phil Willoughby
2006-08-30 07:35:21 UTC
Permalink
Post by l***@hotmail.com
If there are multiple JMS Sessions and MessageConsumer instances
consuming from the same queue, how to guarrentee the order of
processing the messages? In other words, how to config the queue such
that only one MessageConsumer is active at one time? Thanks.
If you need to ensure that a number of related messages are processed
without another consumer receiving a message from the middle of the
group I recommend you use message grouping rather than requiring that
your queue be accessed serially. See this article:
http://www-128.ibm.com/developerworks/websphere/library/techarticles/0602_currie/0602_currie.html

If you decide you really want to only have one application consuming
messages at a time you can use the following runmqsc command on your
queue manager:

ALTER QLOCAL('your_queue_name_goes_here') NOSHARE

Regards,

Phil Willoughby
--
Software Engineer (Development)
IBM Message Service Clients for C/C++
Loading...