Pergunta

I was reading about (and have sample implemented) JMS Topic Subscribers on Tibco MoM. These are the links that I am referring to : Link1

However, I was not clear about how the transaction is going to be managed over multiple subscribers. I am using DefaultMessageListenerContainer as the Container and a durable Subscription.

Typically, when the onMessage of a subscriber completes, the transaction is committed. How does it happen over multiple subscribers?

Now, suppose Subscriber1 received the message and processed an action based on it (The action cannot be reversed). Later Subscriber2 came alive and tried to process this message. Something went wrong and now the transaction has to be rolled back - Message will be put back in the Topic.

Next, will the Subscriber1 see the Message again? Will it have to consume the message again? Is this a case of distributed transactions? When does commit happen?

Foi útil?

Solução

Each subscriber receives its messages in its own transaction, and provided the transaction commits successfully, the individual subscriber will not see that message again. On a subscriber transaction rollback,the message will be redelivered to the failing subscriber only (assuming the broker is not limiting redeliveries).

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top