-
Notifications
You must be signed in to change notification settings - Fork 67
Description
Hi,
The JMS Spout implements the ack() and fail() mechanisms by JMS message acknowledgment and JMS session recovery. One very important fact that is usually misunderstood in JMS is that the JMS message.acknowledge() call acknowledges the whole JMS session up to that moment, not just that particular message.
http://docs.oracle.com/javaee/5/api/javax/jms/Message.html#acknowledge%28%29
void acknowledge()
throws JMSException
Acknowledges all consumed messages of the session of this consumed message.
So, if you have received 2 JMS messages, msg1 and msg2 (in that order), msg2 is successfully processed, msg1 has failed and the acknowledgment for the msg2 is received first, msg1 won’t be redelivered.
Probably the message reply mechanism in the JMS case shall use some intermediate (semi) persistent storage (Hazelcast map for example).