|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Multiple clients,single queue |
« View previous topic :: View next topic » |
Author |
Message
|
kinf1 |
Posted: Wed Mar 15, 2006 10:44 pm Post subject: Multiple clients,single queue |
|
|
Novice
Joined: 15 Mar 2006 Posts: 15
|
Hi,
There are multiple clients listening on a single queue. Depending upon the correlation id of the message,a client consumes the corresponding message.If the message's correlation id does not match with the client,the client puts it back on the queue.The problem I'm facing is that once a client consumes a wrong message, it keeps reading the same message again and again.It does not read the message that it is supposed to because it is caught up with the wrong message that has been sent first.
When a message is sent, it is put at the end of the queue.And so, the client should read the next message in the queue(FIFO). But this is not happening.
Could someone help me out. |
|
Back to top |
|
 |
elvis_gn |
Posted: Wed Mar 15, 2006 11:04 pm Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi kinf1,
You should post your code...
First of all, u dont need to read and put the message again and again...just browse the list and keep going....
About ur picking the same message everytime, it is most probably because of not clearing the properties of the message that you just picked...If you clear that, it should pick the next...
It would be easire if you posted the code.
Regards. |
|
Back to top |
|
 |
RogerLacroix |
Posted: Wed Mar 15, 2006 11:08 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
Hi,
Quote: |
There are multiple clients listening on a single queue. Depending upon the correlation id of the message,a client consumes the corresponding message.If the message's correlation id does not match with the client,the client puts it back on the queue. |
First off, bad design. Secondly, how are you putting the message back on the queue?
Are you getting the message under SyncPoint then issuing the backout command? If so, this is your problem because backout command puts the message back to the TOP of the queue.
The proper way to code your application is to do a "Get-By-CorrelationId". Hence, you will ONLY get the message you are looking for.
Regards,
Roger Lacroix
Capitalware Inc. _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
kinf1 |
Posted: Wed Mar 15, 2006 11:54 pm Post subject: |
|
|
Novice
Joined: 15 Mar 2006 Posts: 15
|
Thanks Roger n Elvis,
I didn't know that there was such a function. I used a message selector and got it work. Thanks a lot. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Mar 16, 2006 3:42 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Make sure when using the message selector to use the provider native form:
JMSCorrelationID="ID:xxxx" it has important performance implications.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|