Skip to main content

Using Message redelivery in Generic JMS RA with WebSphere MQ 6.0

Posted by rampsarathy on May 14, 2007 at 5:04 AM EDT
Redelivery with WSMQ 6.0
Using Message redelivery in Generic JMS RA with WebSphere MQ 6.0

Reliable redelivery feature has been available since  generic ra 1.7. During message redeliveries, a new transaction is started by the container every time the MDB endpoint is invoked. Redelivery stratergies are implemented based on how this transaction is handled by the RA and when the state changes have to be propagated to the resource manager of the MoM provider. In the reliable redelivery stratergy, the transaction was not started (at the resource manager) by delaying it until a succesful delivery was performed to the MDB endpoint, this ensured that transaction recovery was possible.  For example if first 2 attempts in delivering the message fail and the third attempt succeds and XA1 , XA2 and XA3 are the transaction ids that were started by the container, then generic ra would ignore XA1 and XA2 use only XA3 to propate the transaction state changes to the resource manager.
But some MoM providers like WSMQ 6.0, expect a transaction to be started before the session (ServerSession) run() method is called. The delayed XA logic cannot be used in such cases.  The transaciton has to be started (at the RM end) before the server session is run(). To accomodate for this, the first transaction that is started by the container is stored by the RA and all the subsequent transactions (one for each redelivery attempt) that are started by the container are ignored. This of course has the disadvantage that transaction recovery (of the transaction manager) logic cannot be used here. For example if first 2 attempts in delivering the message fail and the third attempt succeds and XA1 , XA2 and XA3 are the transaction ids that were started by the container, then generic ra would ignore XA2 and XA3 use only XA1 to propate the transaction state changes to the resource manager.
We would like to use reliable redelivery with MoM providers that allow it, at the same time allowing us to fall back to a conservative redelivery startergy to work with certain MoM providers like WSMQ series.
In version generic ra 1.7-final  (and higher) a new RA property has been introduced to fall back to the conservative redelivery logic, this flag "UseFirstXAForRedelivery" when set to true would ensure that redelivery works with WSMQ 6.0 type MoM providers. The default value for this property ""UseFirstXAForRedelivery" will be false, which means that the reliable redelivery will be used by default.

Please, remember to set this propery "UseFirstXAForRedelivery" to true during "create-resource-adapter-config" when using GRA 1.7-final and above with  WSMQ 6.
Related Topics >>