0% found this document useful (0 votes)
10 views

Configuring adapter and listener using TOCF

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Configuring adapter and listener using TOCF

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 19

Configuring adapter and listener using TOCF(EE) in JBoss R10, R11 & R12

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: 2 Create t24OFSQueueMQ and t24OFSReplyQueueMQ queues in the t24-


destinations-service.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: jbossmq-destinations-service.xml 25907 2004-11-16 04:32:39Z ejort $ -->
<!--
| This file defines the default Queues and Topics that JBossMQ
| ships with. The default Queues and Topics are used by the
| JBoss test suite and by the sample jms programs.
|
| You can add other destinations to this file, or you can create other
| *-service.xml files to contain your application's destinations.
-->
<server>
<!-- Destination without a configured SecurityManager or without a
a SecurityConf will default to role guest with read=true, write=true,
create=false.
-->
<mbean code="org.jboss.mq.server.jmx.Queue"
name="jboss.mq.destination:service=Queue,name=t24OFSQueueMQ"
>
<depends optional-attribute-
name="DestinationManager">jboss.mq:service=DestinationManager</depends>
</mbean>
<mbean code="org.jboss.mq.server.jmx.Queue"
name="jboss.mq.destination:service=Queue,name=t24OFSReplyQueu
eMQ">
<depends optional-attribute-
name="DestinationManager">jboss.mq:service=DestinationManager</depends>
</mbean>
<mbean code="org.jboss.mq.server.jmx.Topic"
name="jboss.mq.destination:service=Topic,name=tecEvents">
<depends optional-attribute-
name="DestinationManager">jboss.mq:service=DestinationManager</depends>
</mbean>
</server>

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.

<?xml version="1.0" ?>


<!-- DOCTYPE LISTENER SYSTEM "../dtd/LISTENER.dtd" -->
<!-- GLOBUS Connector communications server LISTENERs definitions -->
<!-- T&R Department 2002 -->
<!-- Please check the installation documentation for a detailed
description of this file -->
<TCSERVER>
<ADAPTERS>
<!--
This type of adapter 'TOCF' will process requests using the message endpoint
(tocflistener-mdb)
that activated the plugin. An adapter instance will process messages using at
most one tocflistener-mdb.
If you require more than one tocflistener-mdb configuration to be called (for
different listeners)
then you must configure one ADAPTER instance per tocflistener-mdb.
-->
<ADAPTER id="T24" type="TOCF" active="true">
<!--
<REQUEST_FORMATTER>Thai2UTF, OFSML,
UTF2Thai</REQUEST_FORMATTER>
<RESPONSE_FORMATTER>Thai2UTF, OFSML,
UTF2Thai</RESPONSE_FORMATTER>
-->
<!-- Configure the number of threads that will deliver messages to the
associated tocflistener-mdb -->
<MAX_SESSION>20</MAX_SESSION>
<MIN_SESSION>20</MIN_SESSION>
<!--
Configure the charset of the incoming messages. By default the tocflistner
is expecting to
receive messages encoded in the Java platform default Charset. You may
either use a request
formatter to change the messages format to the default encoding or inform
the tocflistener of
the encoding of the message using the following parameter.
<CHARSET>UTF-8</CHARSET>
-->
<!--
Configure the number of seconds this adapter will wait for the processing of
a message.
NOTE - this adapter delivers messages the tocflistener-mdb which in turn
delivers the
message to the ofsRequestQueue for processing. The following timeout
should be a value
longer than the total time for this processing including the possible retries of
the
ofsmessage-mdb. See the TOCF(EE) user guide for more details.
-->
<TIMEOUT>60</TIMEOUT>
</ADAPTER>

<ADAPTER id="T24_formatter" type="TOCF" active="true">


<REQUEST_FORMATTER>OFSML</REQUEST_FORMATTER>
<RESPONSE_FORMATTER>OFSML</RESPONSE_FORMATTER>
<MAX_SESSION>5</MAX_SESSION>
<MIN_SESSION>5</MIN_SESSION>
<TIMEOUT>60</TIMEOUT>
</ADAPTER>
</ADAPTERS>
<MESSAGEFORMATTERS>
<!--
================================================
Sample Formatters converting charsets
===============================================
==-->
<MESSAGEFORMATTER id="Thai2UTF" type="charsetformatter">
<FROM>CP838</FROM>
<TO>UTF-8</TO>
</MESSAGEFORMATTER>
<MESSAGEFORMATTER id="UTF2Thai" type="charsetformatter">
<FROM>UTF-8</FROM>
<TO>CP838</TO>
</MESSAGEFORMATTER>
</MESSAGEFORMATTERS>
<LISTENERS>
<LISTENER Name="mq1" type="mqseries" active="true">
<ADAPTERID>T24</ADAPTERID>
<MQHOST>10.92.11.15(1414)</MQHOST>
<MQCHANNEL>QMGR1.CH</MQCHANNEL>
<MQMANAGER>QMGR1</MQMANAGER>
<MQQUEUE>Q/IN</MQQUEUE>
<NBTHREADS>3</NBTHREADS>
<CONSUMER>
<MQQUEUE>Q/OUT</MQQUEUE>
</CONSUMER>
<!--
<RFH2>
<ACTION type="replace" path="mcd/Msd" value="test1"/>
<ACTION type="suffix" path="mcd/Msd" value="_suff1"/>
<ACTION type="replace" path="jms/Rto" value="test22"/>
<ACTION type="replace" path="usr/StringTag1"
value="test3"/>
<ACTION type="prefix" path="usr/StringTag1"
value="prefix_"/>
</RFH2>

<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\)

<?xml version="1.0" encoding="UTF-8"?>


<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 4.0//EN"
"http://www.jboss.org/j2ee/dtd/jboss_4_0.dtd">
<jboss>
<!--
<security-domain>java:/jaas/T24App</security-domain>
-->
<enterprise-beans>
<message-driven>
<ejb-name>OFSMessageMDBMQ</ejb-name>
<destination-jndi-name>queue/t24OFSQueueMQ</destination-jndi-
name>
<resource-ref>
<res-ref-name>jms/jmsConnectionFactory</res-ref-name>
<jndi-name>java:/ConnectionFactory</jndi-name>
</resource-ref>
<resource-ref>
<res-ref-name>queue/t24OFSReplyQueue</res-ref-name>
<!-- <res-type>javax.jms.Queue</res-type>
-->
<jndi-name>queue/t24OFSReplyQueueMQ</jndi-name>
</resource-ref>
<resource-ref>
<res-ref-name>eis/t24ConnectionFactory</res-ref-name>
<jndi-name>java:jca/t24ConnectionFactoryMQ</jndi-name>
<!-- <res-type>com.jbase.jremote.JConnectionFactory</res-type>
-->
</resource-ref>
</message-driven>
</enterprise-beans>
</jboss>
Step: 6
In ejb-jar.xml present under the tocfOFSmessage-ejb.jar (…\jboss\server\default\
deploy\ tocfee.ear\tocfOFSmessage-ejb.jar\META-INF\)
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar id="EJBJar_OfsMessageMDB" 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>OFSMessage</display-name>
<enterprise-beans>
<message-driven id="MessageDriven_OfsMessageMDB">
<display-name>OFSMessage Bean</display-name>
<ejb-name>OFSMessageMDBMQ</ejb-name>
<ejb-class>com.temenos.tocf.ofsmessage.mdb.OFSMessageMDB</ejb-
class>
<messaging-type>javax.jms.MessageListener</messaging-type>
<transaction-type>Bean</transaction-type>
<message-destination-type>javax.jms.Queue</message-destination-type>
<activation-config>
<activation-config-property>
<activation-config-property-name>acknowledgeMode</activation-
config-property-name>
<activation-config-property-value>Auto-acknowledge</activation-
config-property-value>
</activation-config-property>
</activation-config>
<resource-ref id="ResourceRef_jmsQueueConnectionFactory">
<description>T24 Queue Connection Factory</description>
<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_t24ConnectionFactory">
<description>T24 JCA Connection Factory</description>
<res-ref-name>eis/t24ConnectionFactory</res-ref-name>
<res-type>com.temenos.tocf.t24ra.T24ConnectionFactory</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<resource-ref id="ResourceRef_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>
<!--
<assembly-descriptor>
<security-role>
<role-name>t24user</role-name>
</security-role>

<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\)

<?xml version="1.0" encoding="UTF-8"?>


<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 4.0//EN"
"http://www.jboss.org/j2ee/dtd/jboss_4_0.dtd">
<jboss>
<enterprise-beans>
<message-driven>
<ejb-name>OFSListenerMDBMQ</ejb-name>
<resource-adapter-name>tocfee.ear#tocfplugin-ra.rar</resource-adapter-
name>
<resource-ref>
<res-ref-name>jms/jmsConnectionFactory</res-ref-name>
<jndi-name>java:/ConnectionFactory</jndi-name>
</resource-ref>
<resource-ref>
<res-ref-name>queue/t24OFSQueue</res-ref-name>
<jndi-name>queue/t24OFSQueueMQ</jndi-name>
</resource-ref>
<resource-ref>
<res-ref-name>queue/t24OFSReplyQueue</res-ref-name>
<jndi-name>queue/t24OFSReplyQueueMQ</jndi-name>
</resource-ref>
</message-driven>
<!-- COMMENT OTHER LISTENERS
<message-driven>
<ejb-name>RAWTCPOFSListenerMDB</ejb-name>
<resource-adapter-name>tocfrawtcp-ra.rar</resource-adapter-name>
<resource-ref>
<res-ref-name>jms/jmsConnectionFactory</res-ref-name>
<jndi-name>java:/ConnectionFactory</jndi-name>
</resource-ref>
<resource-ref>
<res-ref-name>queue/t24OFSQueue</res-ref-name>
<jndi-name>queue/t24OFSQueue</jndi-name>
</resource-ref>
<resource-ref>
<res-ref-name>queue/t24OFSReplyQueue</res-ref-name>
<jndi-name>queue/t24OFSReplyQueue</jndi-name>
</resource-ref>
</message-driven>
<message-driven>
<ejb-name>BytesOFSListenerMDB</ejb-name>
<resource-adapter-name>tocfbytes-ra.rar</resource-adapter-name>
<resource-ref>
<res-ref-name>jms/jmsConnectionFactory</res-ref-name>
<jndi-name>java:/ConnectionFactory</jndi-name>
</resource-ref>
<resource-ref>
<res-ref-name>queue/t24OFSQueue</res-ref-name>
<jndi-name>queue/t24OFSQueue</jndi-name>
</resource-ref>
<resource-ref>
<res-ref-name>queue/t24OFSReplyQueue</res-ref-name>
<jndi-name>queue/t24OFSReplyQueue</jndi-name>
</resource-ref>
</message-driven>
<message-driven>
<ejb-name>BatchFileOFSListenerMDB</ejb-name>
<resource-adapter-name>tocfbatchfile-ra.rar</resource-adapter-name>
<resource-ref>
<res-ref-name>jms/jmsConnectionFactory</res-ref-name>
<jndi-name>java:/ConnectionFactory</jndi-name>
</resource-ref>
<resource-ref>
<res-ref-name>queue/t24OFSQueue</res-ref-name>
<jndi-name>queue/t24OFSQueue</jndi-name>
</resource-ref>
<resource-ref>
<res-ref-name>queue/t24OFSReplyQueue</res-ref-name>
<jndi-name>queue/t24OFSReplyQueue</jndi-name>
</resource-ref>
</message-driven>
-->
</enterprise-beans>
</jboss>

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.

3. Put a message in Request queue(in our case, Q/IN)


4. Mqseries listener will pick the requests from IN queue(Q/IN) and put
the responses in OUT queue(Q/OUT).

You might also like