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.
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?
Googling doesn't make you a genius. But not Googling makes you dumber.
Joined: Apr 08, 2009
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?
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.