Author |
Message
|
bharathgvsmq |
Posted: Mon Feb 09, 2015 1:57 am Post subject: Exclusive consumer concept in Websphere MQ? |
|
|
Newbie
Joined: 09 Feb 2015 Posts: 3
|
Hi Guys,
We are trying for a multiple consumer scenario on the same queue in Websphere MQ. Here is the requirement.
A queue 'TESTQ' will be listened by two consumers(two instances of an application in different servers). We are trying for high availability and also sequential processing of messages i.e., only one consumer(Server1) should get all the messages from the queue and only when it is down the second consumer(Server2) should pick the messages from queue. This is required for the sequential processing of the messages.
I have found that there is a concept called 'Exclusive Consumer' in Active MQ which will do this for us. Please help me with the similar kind of concept in Websphere MQ.
Thanks in advance.
Bharath |
|
Back to top |
|
 |
zpat |
Posted: Mon Feb 09, 2015 2:27 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Open the queue with the option MQOO_INPUT_EXCLUSIVE
Or set this as the default in the queue attributes.
However the second consumer will be unable to open the queue when the first has it open. You should configure the second consumer so that it retries to open the queue at regular intervals. _________________ Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error. |
|
Back to top |
|
 |
bharathgvsmq |
Posted: Mon Feb 09, 2015 2:55 am Post subject: |
|
|
Newbie
Joined: 09 Feb 2015 Posts: 3
|
Thank u very much for the reply. I got the MQOPEN part but please tell me which queue attribute do I need to set for MQOO_INPUT_EXCLUSIVE. Setting it in the queue definition level will be really useful.
Thanks again..! |
|
Back to top |
|
 |
zpat |
Posted: Mon Feb 09, 2015 3:22 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
It's all in the knowledge center. Default Input Option. Don't forget that this can be overridden by the application. DEFSOPT(EXCLUSIVE) _________________ Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error. |
|
Back to top |
|
 |
bharathgvsmq |
Posted: Mon Feb 09, 2015 6:04 am Post subject: |
|
|
Newbie
Joined: 09 Feb 2015 Posts: 3
|
Thank u very much for that zpat. That was really helpful  |
|
Back to top |
|
 |
gbaddeley |
Posted: Mon Feb 09, 2015 4:03 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
Be aware that MQ does not guarantee the sequence of messages on a queue. The time order they are put by producer app(s) is not necessary the order than consumer app(s) will get them. A requirement for message sequence affinity will need to be part of the app design and coding. This usually involves temporarily storing the messages in a DB or using some other marshalling / delayed / missing message handling techniques. The MQ message group feature may also offer a solution. _________________ Glenn |
|
Back to top |
|
 |
zpat |
Posted: Mon Feb 09, 2015 10:43 pm Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
However if they are put on the queue by one producer, with the same priority, and there is only one route to the other QM (or it is the same queue manager) then the order will be the same. _________________ Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error. |
|
Back to top |
|
 |
|