Win a copy of Python Continuous Integration and Delivery this week in the Python forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

JMS - Duplicate Messages Check  RSS feed

 
Ranch Hand
Posts: 387
2
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In JMS, is it possible to deliver the same message twice/multiple times? If yes, then how can we avoid it - do we have any broker specific property which needs to be set to avoid duplicate messages?
 
Saloon Keeper
Posts: 5282
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this a hypothetical scenario you're wondering about, or an actual problem you've encountered? It sounds like a bug to me.
 
Vaibhav Gargs
Ranch Hand
Posts: 387
2
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am just thinking about hypothetical scenario. In case, we don't get acknowledgement from the client and hence, i guess broker can send the message again considering it was not delivered.
 
author
Posts: 23816
140
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is not hypothetical. This is true with all messaging systems. The (durable) subscriber is always responsible for duplicate detection.

Think about it. The broker delivers the message to the subscriber. The subscriber (along with the whole client application) dies. Then the subscriber comes back (when the application is restarted)... did the subscriber get the message? and if so, did the subscriber processed it? and if so, did it process it to completion?

The messaging environment always choose to resend under these edge conditions -- meaning it will choose to guarantee the delivery over avoiding duplicates.

Henry

PS... Yes, XA transactions would help here, but keep in mind, this is not in common usage -- and not many messaging environments support them.
 
I have gone to look for myself. If I should return before I get back, keep me here with this tiny ad:
Become a Java guru with IntelliJ IDEA
https://www.jetbrains.com/idea/
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!