Red Hat Training

A Red Hat training course is available for JBoss Enterprise SOA Platform

15.3.3. Configuring a JCA Inflow Gateway

Configure a JCA inflow gateway by changing the settings in a jboss-esb.xml file:
<service category="HelloWorld_ActionESB"
  name="SimpleListener"
  description="Hello World">
  <listeners>
    <jca-gateway name="JMS-JCA-Gateway"
     adapter="jms-ra.rar"
     endpointClass="org.jboss.soa.esb.listeners.jca.JmsEndpoint">
    <activation-config>
     <property name="destinationType" value="javax.jms.Queue"/>
     <property name="destination" value="queue/esb_gateway_channel"/>
    </activation-config>
  </jca-gateway>
...
 </service>
<service category="HelloWorld_ActionESB"
  name="SimpleListener"
  description="Hello World">
  <listeners>
    <jca-gateway name="JMS-JCA-Gateway"
     adapter="jms-ra.rar"
     endpointClass="org.jboss.soa.esb.listeners.jca.JmsEndpoint">
    <activation-config>
     <property name="destinationType" value="javax.jms.Queue"/>
     <property name="destination" value="queue/esb_gateway_channel"/>
    </activation-config>
  </jca-gateway>
...
 </service>
JCA gateways are defined in <jca-gateway> elements. These are the configurable attributes of this XML element.

Table 15.1. jca-gateway Configuration Attributes

Attribute Required Description
name yes The name of the gateway
adapter yes The name of the adapter you are using. In JBoss it is the file name of the RAR you deployed, for example jms-ra.rar
endpointClass yes The name of your end point class.
messagingType no The message interface for the adapter. If you do not specify one, ESB will guess based on the endpoint class.
transacted no Default to true. Whether or not you want to invoke the message within a JTA transaction.
You must define an <activation-config> element within <jca-gateway>. This element takes one or more <property> elements which have the same syntax as action properties. The properties under <activation-config> are used to create an activation for the JCA adapter that will be used to send messages to your endpoint class. This is really no different than using JCA with MDBs.
You may also have as many <property> elements as you want within <jca-gateway>. This option is provided so that you can pass additional configuration to your endpoint class. You can read these through the ConfigTree passed to your constructor.