2

I have an issue related to java messaging service ... Problem: suppose my JMS publisher sends me 5 messages... When I receive first two messages my app processes them and acknowledges them... So that it is removed from the topic... Wen I receive 3rd message, because of some problem my app cannot process it and doesn't acknowledge... But 4th and 5th message got processed and acknowledged... But wen I checked the admin console I found out that the 3rd message is also acknowledged...

I want to know how to acknowledge each message individually. Anybody has idea???

Note: I'm using CLIENT_ACKNOWLEDGE mode.

Oliv
  • 10,221
  • 3
  • 55
  • 76

1 Answers1

1

According to JMS specification CLIENT_ACKNOWLEDGE - acknowledging a consumed message automatically acknowledges the receipt of all messages that have been delivered by its session.

Many JMS providers have implemented above specification and hence don't provide acknowledging one message. But some JMS providers (AcitveMQ ??) do implement per message acknowledgement. So you will need to check with your JMS provider if it supports per message acknowledgement feature.

Shashi
  • 14,980
  • 2
  • 33
  • 52
  • Yes I guess weblogic doesn't support per message acknowledgement... Is it possible to make a custom acknowledgement... Which will acknowledge messages individually... Any idea?? – user2991214 Jun 01 '15 at 03:44
  • Currently Tibco and ActiveMQ provide this INDIVIDUAL_ACK mode. This is in consideration for JMS2.1 spec too! With current WebLogic you don't have much choice. Try setting the Connection Factory Acknowledgement mode to Previous and do a session.recover() as soon as it fails. – satks Jun 13 '15 at 16:44