Skip to content

JMS Spout ack() and fail() implementation #4

@marjan-sterjev

Description

@marjan-sterjev

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions