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 Index » IBM MQ Java / JMS » Multiple clients,single queue

Post new topic  Reply to topic
 Multiple clients,single queue « View previous topic :: View next topic » 
Author Message
kinf1
PostPosted: Wed Mar 15, 2006 10:44 pm    Post subject: Multiple clients,single queue Reply with quote

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
View user's profile Send private message
elvis_gn
PostPosted: Wed Mar 15, 2006 11:04 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
RogerLacroix
PostPosted: Wed Mar 15, 2006 11:08 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
kinf1
PostPosted: Wed Mar 15, 2006 11:54 pm    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Thu Mar 16, 2006 3:42 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Multiple clients,single 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.