• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Duplicate JMS message processing with multiple MessageListener threads

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 66
VI Editor Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 171
Hibernate Spring Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
30 seconds to difuse a loaf of bread ... here, use this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic