• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Duplicate JMS message processing with multiple MessageListener threads

 
Haq Yunus
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am creating a JMS listener application which listens on a queue. I am using TIBCO JMS
implementation and facing an issue that intermittently more than one of my listener threads
pick up a same message and that results in duplicate processing.

Here is how I am creating the connection:


Then here I am creating the listener threads with the same connection created above



Now here let us assume, 5 listener threads are created and they listen as receivers on a queue. I am seeing a behavior that
sometime more than one listener thread/receiver picks up the same message and I end up with duplicate processing? How can I
handle it through JMS configuration? Is it even possible? Or I would have to resort to some programmatic solution? Any advise
would be much appreciated. Thanks.

Cross-posted at:http://stackoverflow.com/questions/10191184/duplicate-message-processing-with-multiple-messagelistener-threads
 
Prabaharan Gopalan
Ranch Hand
Posts: 66
Java Linux VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May be an obvious thing to ask: But I saw you specify 'Explicit client acknowledge'. But do all your listeners explicitly acknowledge the message reception once they are done? Easy way to check, is there a time difference between the message being processed by the first listener and the second one? Do you have the DUPS_OK_ACKNOWLEDGE setting on?
 
Haq Yunus
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.

Yes , listeners do acknowledge explicitly.

Easy way to check, is there a time difference between the message being processed by the first listener and the second one?
So for this I would have to maintain a map or some mechanism for common repository so listeners can check what message has been processed, right?

DUPS_OK_ACKNOWLEDGE is not on.
 
Anurag Verma
Ranch Hand
Posts: 168
Hibernate Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you are opting for Client Acknowledge while creating Queue Session, the only reason i could see(there may be more) for multiple clients getting the message is the timeout for acknowlegment is less (or may be client is taking much time to acknowledge). Try increasing the timeout for this, atleast upto some value when your client can process the message & acknowledge back. hope that works.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic