There are 2 JBoss instances, a JMS client and a server. The client instance defines a RemoteJMSProvider and uses JMS XA resource adapter to connect to the server.
MessagingXAResourceRecovery is configured on the client instance and it works fine as long as the server instance keeps running. Once the server instance restarted, the MessagingXAResourceRecovery doesn't get working anymore and repeats the following WARN in every recovery:
> 2009-04-27 15:45:42,479 WARN [com.arjuna.ats.jta.logging.loggerI18N] [com.arjuna.ats.internal.jta.recovery.xarecovery1] Local XARecoveryModule.xaRecovery got XA exception javax.transaction.xa.XAException, XAException.XAER_RMFAIL
Looking at the Messaging code, the MessagingXAResourceWrapper only recreate connection when XA_RETRY is returned. When the remote instance restarts it gets XAER_RMFAIL and reuses dead connection every time.
If there is no specific reason on this behavior we might want to recreate connection with any XAException.
How to reproduce:
- Define RemoteJMSProvider in deploy/remote-jms-ds.xml on the client instance
- Configure MessagingXAResourceRecovery in conf/jbossjta-properties.xml on the client instance
- (No config is needed on the server instance)
- Boot the client and server instances
- Check the recovery works on the client
- Stop the server
- Check the recovery WARNs on the client
- Start the server
- You'll see the recovery is not recovered
I've attached a zip file which contains configurations and logs. Tested with EAP 4.3.0.GA_CP02 (and confirmed it's still reproducible with CP04).
- debug.patch (for generate server.log.debug. It seems the MessagingXAResourceWrapper/ResourceManager swallow the root cause exception)
Note that the remote-jms-ds.xml doesn't have resource adpter definition because it's not needed for testing recovery.