XAConnectionFactory/XAQueueConnectionFactory resource injection

57 views
Skip to first unread message

Ahmed Theba

unread,
Mar 15, 2016, 5:06:38 AM3/15/16
to Generic JMS JCA Resource Adapter for JBoss AS
Hi,

With regards to outbound messaging, the resource adapter doesn't currently support resource injection of XAConnectionFactory. Therefore any calls to createXAQueueConnection() and subsequently createXAQueueSession() are not supported. This is due to the fact that interface JmsConnectionFactory from the resource adapter extends ConnectionFactory, TopicConnectionFactory, QueueConnectionFactory only. 

This is a non-issue as according to the EE7 API i.e. ConnectionFactory with createSession supports XA behind the scenes: 

"In a Java EE web or EJB container, when there is an active JTA transaction in progress:

  • Both arguments transacted and acknowledgeMode are ignored. The session will participate in the JTA transaction and will be committed or rolled back when that transaction is committed or rolled back, not by calling the session's commit or rollback methods. Since both arguments are ignored, developers are recommended to use createSession(), which has no arguments, instead of this method."

EE6 behaviour is the same bar the ability to call the parameter-less createSession(). Is there any other ability lost by not supporting the XA connection factories for EE6/7?





Justin Bertram

unread,
Mar 15, 2016, 10:08:44 AM3/15/16
to Generic JMS JCA Resource Adapter for JBoss AS
Is there any other ability lost by not supporting the XA connection factories for EE6/7?
 
No, I don't think so.  If you look at org.jboss.resource.adapter.jms.JmsManagedConnection#setup (which is what ultimately gets called when a client calls createSession()) then you'll see that the proper XA connection and session are created when the possible.

Also, if you look at the JavaDoc for XAConnectionFactory it says, "Client programs are strongly encouraged to use the transactional support available in their environment, rather than use these XA interfaces directly."  In other words, you shouldn't use the XA interfaces directly unless you absolutely have to and in a Java EE environment you don't have to so you're "strongly encouraged" not to.

Ahmed Theba

unread,
Mar 17, 2016, 9:06:23 AM3/17/16
to Generic JMS JCA Resource Adapter for JBoss AS
Hi Justin,

Thanks for your input and yes I have seen that within the JmsManagedConnection class.

Regards,
Ahmed Theba
Reply all
Reply to author
Forward
0 new messages