ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexGeneral IBM MQ SupportMultiple IMessageConsumers on same queue

Post new topicReply to topic
Multiple IMessageConsumers on same queue View previous topic :: View next topic
Author Message
dudetom
PostPosted: Thu Jul 12, 2018 10:49 pm Post subject: Multiple IMessageConsumers on same queue Reply with quote

Apprentice

Joined: 29 Sep 2017
Posts: 38

We plan to deploy multiple client application instances on different servers (for failover & load-balancing reasons). These client applications are actually duplicates of each other and they make connections on the same way and consume messages out of the same queue.

We use IBM MQ Client 8.0.0.5 with IBM.XMS and C#.

We have 2 questions:
1. If there are multiple consumers on one queue, on which consumer does a message arrive? Is there some kind of auto Round-Robin balancing?
2. Does one message arrive on all consumers or is it removed from the queue when it's consumed by one client application?
Back to top
View user's profile Send private message
hughson
PostPosted: Thu Jul 12, 2018 11:58 pm Post subject: Re: Multiple IMessageConsumers on same queue Reply with quote

Sentinel

Joined: 09 May 2013
Posts: 813
Location: Bay of Plenty, New Zealand

dudetom wrote:
1. If there are multiple consumers on one queue, on which consumer does a message arrive? Is there some kind of auto Round-Robin balancing?
Generally speaking the queue manager will endeavour to keep one consumer 'hot' as this is a more efficient use of O/S resources.
dudetom wrote:
2. Does one message arrive on all consumers or is it removed from the queue when it's consumed by one client application?
That depends on how you write your consumers. If you browse the messages then they are not removed, if you get them in a destructive manner (i.e. the opposite of a browse) then yes they are removed and only one consumer will see the message.

P.S. None of this is specific to XMS and C#

Cheers,
Morag
_________________
Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software
Back to top
View user's profile Send private message Visit poster's website
fjb_saper
PostPosted: Fri Jul 13, 2018 1:38 am Post subject: Reply with quote

Grand Poobah

Joined: 18 Nov 2003
Posts: 19758
Location: LI,NY

If you have multiple receivers for your messages, you should make sure that each uses a Unit of Work and transaction...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
dudetom
PostPosted: Fri Jul 13, 2018 3:09 am Post subject: Re: Multiple IMessageConsumers on same queue Reply with quote

Apprentice

Joined: 29 Sep 2017
Posts: 38

Morag, I didn't set anything like browse or something else on my listeners.

We use MessageListener objects (XMS) like below, nothing special.

consumer = session.CreateConsumer(destination);
consumer.MessageListener = listener;

Is this a destructive manner ?


Last edited by dudetom on Fri Jul 13, 2018 3:13 am; edited 1 time in total
Back to top
View user's profile Send private message
dudetom
PostPosted: Fri Jul 13, 2018 3:11 am Post subject: Reply with quote

Apprentice

Joined: 29 Sep 2017
Posts: 38

fjb_saper, why would a unit of work be requirement in case of multiple consumers? It should always be a requirement?

We don't throw any exception in the listener method anyway. We catch all exceptions.
Back to top
View user's profile Send private message
hughson
PostPosted: Fri Jul 13, 2018 3:32 am Post subject: Re: Multiple IMessageConsumers on same queue Reply with quote

Sentinel

Joined: 09 May 2013
Posts: 813
Location: Bay of Plenty, New Zealand

dudetom wrote:
Morag, I didn't set anything like browse or something else on my listeners.

We use MessageListener objects (XMS) like below, nothing special.

consumer = session.CreateConsumer(destination);
consumer.MessageListener = listener;

Is this a destructive manner ?
Yes that will be destructive.
To browse you would use a Queue Browser.

Read more: Queue Browsers

Cheers,
Morag
_________________
Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexGeneral IBM MQ SupportMultiple IMessageConsumers on same queue
Jump to:



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.