Configuring adapter and listener using TOCF
Configuring adapter and listener using TOCF
Introduction
The purpose of this document is to setup adapter and listener setup using TOCF(EE)
in JBoss. Here, we have taken mqseries listener as sample and TOCF adapter which
is the adapter type we have to use with tocfplugin-ra.rar. The same can be applied
for other listeners also.
Deployment of Components in Jboss
Kindly make ensure that the following files are present under the path (…\jboss \
server\default\deploy).
1. tocfT24ra-ra.rar
2. t24-ds.xml
3. t24-destinations-service.xml
4. tocfOFSmessage-ejb.jar (present in the tocfee.ear)
5. tocflistener-ejb.jar (present in the tocfee.ear)
6. tocfplugin-ra.rar (present in the tocfee.ear)
Note: TOCF(EE) pack will contain both tocfT24ra-ra.rar and tocfee.ear files.
The components will get deployed once the JBoss is started.
For example, we have taken mqseries listener and TOCF adapter which is the
adapter type we have to use with tocfplugin-ra.rar.
Configuration of the Files
Step: 1 Create a t24ConnectionFactory in the t24-ds.xml for setup
jca/t24ConnectionFactory to connect to T24.
<?xml version="1.0" encoding="UTF-8"?>
<connection-factories>
<tx-connection-factory>
<jndi-name>jca/t24ConnectionFactoryMQ</jndi-name>
<rar-name>tocfT24ra-ra.rar</rar-name>
<connection-definition>com.temenos.tocf.t24ra.T24ConnectionFactory</
connection-definition>
<config-property name="hosts" type="java.lang.String">127.0.0.1</config-
property>
<config-property name="ports" type="java.lang.String">20005</config-
property>
<config-property name="loadBalancing"
type="java.lang.Boolean">true</config-property>
<config-property name="allowInput" type="java.lang.Boolean">true</config-
property>
<config-property name="compression" type="java.lang.Boolean">true</config-
property>
<config-property name="compressionThreshold"
type="java.lang.Integer">2048</config-property>
<config-property name="envVariables"
type="java.lang.String">OFS_SOURCE=TELNET</config-property>
<config-property name="actionTimeout" type="java.lang.Integer">90</config-
property>
<config-property name="charset" type="java.lang.String">ISO-8859-1</config-
property>
<min-pool-size>6</min-pool-size>
<max-pool-size>10</max-pool-size>
<idle-timeout-minutes>15</idle-timeout-minutes>
<!--
<config-property name="debugPort" type="java.lang.Integer">30097</config-
property>
<config-property name="SSL" type="java.lang.Boolean">true</config-
property>
<config-property name="NaiveTrustManager"
type="java.lang.Boolean">true</config-property>
<config-property name="account"
type="java.lang.String">MYACCOUNT</config-property>
<config-property name="user" type="java.lang.String">test</config-property>
<config-property name="password"
type="java.lang.String">account_password</config-property>
-->
</tx-connection-factory>
</connection-factories>
Step: 3
In tcserver.xml present under the tocfplugin-ra.rar (…\jboss\server\default\deploy\
tocfee.ear\tocfplugin-ra.rar\), use default adapter 'TOCF' and create mqlistener.
<RFH2>
<ACTION type="prefix" path="mcd/Type" value="RESP_"/>
<ACTION type="suffix" path="mcd/Type" value="_RS"/>
<ACTION type="replace" path="usr/DESTINATION" value=" "/>
<ACTION type="set" path="usr/SOURCE" value="T24"/>
</RFH2>
-->
</LISTENER>
</LISTENERS>
</TCSERVER>
Note: Kindly set 'false' for other listeners if you are not being used.
Step: 4
Under the tocfplugin-ra.rar (…\jboss\server\default\deploy\tocfee.ear\tocfplugin-
ra.rar\), kindly put the following MQ related library files.
Step: 5
In jboss.xml present under the tocfOFSmessage-ejb.jar (…\jboss\server\default\
deploy\ tocfee.ear\tocfOFSmessage-ejb.jar\META-INF\)
<method-permission>
<role-name>t24user</role-name>
<method>
<ejb-name>OFSMessageMDB</ejb-name>
<method-name>*</method-name>
</method>
</method-permission>
</assembly-descriptor>
-->
</ejb-jar>
Step: 7
In jboss.xml present under the tocflistener-ejb.jar (…\jboss\server\default\deploy\
tocfee.ear\tocflistener-ejb.jar\META-INF\)
Step: 8
In ejb-jar.xml present under the tocflistener -ejb.jar (…\jboss\server\default\deploy\
tocfee.ear\tocflistener-ejb.jar\META-INF\)
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar id="EJBJar_TOCFListenerMDB" version="2.1"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
<display-name>OFSListeners</display-name>
<enterprise-beans>
<message-driven id="MessageDriven_OFSListenerMDB">
<display-name>OFSListener Bean</display-name>
<ejb-name>OFSListenerMDBMQ</ejb-name>
<ejb-class>com.temenos.tocf.listener.mdb.TOCFListenerMDB</ejb-class>
<messaging-type>com.temenos.tocf.common.jca.OFSMessageListener</
messaging-type>
<transaction-type>Bean</transaction-type>
<activation-config>
<activation-config-property>
<activation-config-property-name>listener</activation-config-property-
name>
<activation-config-property-value>mq1</activation-config-property-
value>
</activation-config-property>
</activation-config>
<resource-ref
id="ResourceRef_OFSListenerMDB_jmsQueueConnectionFactory">
<res-ref-name>jms/jmsConnectionFactory</res-ref-name>
<res-type>javax.jms.QueueConnectionFactory</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<resource-ref id="ResourceRef_OFSListenerMDB_t24OFSQueue">
<description>OFS queue</description>
<res-ref-name>queue/t24OFSQueue</res-ref-name>
<res-type>javax.jms.Queue</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<resource-ref id="ResourceRef_OFSListenerMDB_t24OFSReplyQueue">
<description>OFS reply queue</description>
<res-ref-name>queue/t24OFSReplyQueue</res-ref-name>
<res-type>javax.jms.Queue</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</message-driven>
</enterprise-beans>
</ejb-jar>
Establishing connection to MQ listener:
Starting of jbase_agent
To connect to T24 environment, we need to start jbase_agent with the port number
(20005) as specified in t24-ds.xml.
jsh r10 ~ -->jbase_agent -p 20005
Starting of JBoss
JBoss can be started by executing the run.bat file present in (..\jboss\bin) directory
or by using the start command shown below,
C:\ jboss\bin>run.bat -b 0.0.0.0
IBM Websphere MQ:
1. IBM WebSphere MQ Server should be installed on the HOST / REMOTE
machine if WMQ based connectivity where to be used.
2. Appropriate Queue Manager, Channel, Request Queue & Response Queue must
be created in the HOST / REMOTE WMQ Server machine if WMQ based connectivity
where to be used.