Configure the Resource Adapter

Specifying Resource Adapter Configuration Properties

A JCA Resource Adapter has several properties defined in his ra.xml which is part of the rar-file. Usually, these properties values are specified during deployment. Unfortunately, there is no possibility in JBoss 4.0.4 to specify these properties. See this issue. Therefore, if you need to change the SMQP-URL etc of the SwiftMQ RA, you need to unpack the rar, modify the default values of the properties in ra.xml and create a new rar.

Configuring Administered Objects (Queues and Topics)

Queues and topic to be used from J2EE components for outbound messaging are defined in a file called "admin-objects-service.xml". Download here.

The file must be placed in JBoss' server/default/deploy directory. For our example we need to declare a queue called "testqueue3":

    <?xml version="1.0" encoding="UTF-8"?>
    <server>
      <mbean code="org.jboss.resource.deployment.AdminObject" name="jca.test:name=testqueue3">
          <attribute name="JNDIName">queue/testqueue3</attribute>
          <depends optional-attribute-name="RARName">
              jboss.jca:service=RARDeployment,name='swiftmq.rar'
          </depends>
          <attribute name="Type">javax.jms.Queue</attribute>
          <attribute name="Properties">QueueName=testqueue3@router1</attribute>
      </mbean>
    </server>

Configuring Connection Factories

Connection factories to be used from J2EE components for outbound messaging are defined in a file called "swift-jms-ds.xml". Download here.

The file must be placed in JBoss' server/default/deploy directory. For our example we need to declare a connection factory called "SwiftMQConnectionFactory":

      <?xml version="1.0" encoding="UTF-8"?>
      <connection-factories>
        <tx-connection-factory>
          <jndi-name>SwiftMQConnectionFactory</jndi-name>
          <xa-transaction/>
          <track-connection-by-tx/>
          <rar-name>swiftmq.rar</rar-name>
          <connection-definition>javax.jms.ConnectionFactory</connection-definition>
          <max-pool-size>30</max-pool-size>
        </tx-connection-factory>
      </connection-factories>