Include XA aware connection factory with EAR
ejb3workshop Jan 11, 2010 11:55 AMI would like to bundle the definition of an XA aware connection factory with my applications EAR. I am already including the destination need by the MDBs using a abc-service.xml file. However I would like to create a xa-transaction aware connection factory similar to those defined in hajndi-jms-ds.xml. I tried included a separate xyz-services.xml file with the following content:
<?xml version="1.0" encoding="UTF-8"?>
<connection-factories>
<!-- JMS XA Resource adapter, use this to get transacted JMS in beans -->
<tx-connection-factory>
<jndi-name>jms/CustomJMSConnectionFactory</jndi-name>
<xa-transaction/>
<rar-name>jms-ra.rar</rar-name>
<track-connection-by-tx/>
<connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition>
<config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>
<config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/DefaultJMSProvider</config-property>
<max-pool-size>20</max-pool-size>
<security-domain-and-application>JmsXARealm</security-domain-and-application>
<use-java-context>false</use-java-context>
</tx-connection-factory>
</connection-factories>
However this didn't work. I know that I could define a connection factory using the following in my abc-service.xml file which is included in my ear.
<mbean code="org.jboss.jms.server.connectionfactory.ConnectionFactory"
name="jboss.messaging.connectionfactory:service=MyConnectionFactory"
xmbean-dd="xmdesc/ConnectionFactory-xmbean.xml">
<depends optional-attribute-name="ServerPeer">
jboss.messaging:service=ServerPeer
</depends>....
however I am not sure if these will have the same transactional properties as those connection factories defined in hajndi-jms-ds.xml. Any information on the differences between the connection factories defined in hajndi-jms-ds.xml and those in jboss-messaging.sar/connection-factories-service.xml / abc-service.xml would help as well. Ideally I am looking for a method to define a connection factory with the same properties as JmsXA and include that within my EAR file.
Thanks in advance
Alex