Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Introduction
This document describes the integration with Web Sphere MQ Series from any J2EE 1.4 compliant application server without custom integration code with the help of JCA 1.5 compliant resource adapter provided by IBM.
Web Sphere MQ implements the industry standard java Message Service (JMS) interface.
Assumptions
This document describes many concepts and prerequisite knowledge of the following is considered essential:
l
JCA
MDB
JMS
jBoss Application Server setup usually comes as jboss-VERSION. packages which can be easily extracted to any desired location.
icon in our system tray which indicates that MQ Server up and running.
Quick Guide to Jboss with MQ- Release R13.00 -Page 2 of 10 - (c) Temenos Systems 2013 05/07/2013
Once the queue manager is up and running User needs to create some local queue (physical destinations) where messages will get stored. To
create queues issue the following command;
Description: First we have to enter into MQSC shell (where we can manipulate our queue manager settings) then we create our queues. Above
two define statement will create t24OFSQueue and t24OFSReplyQueue destinations into queue manager T24QM. While defining queues if
the queen names are not given inside quotes () then it will be created in Uppercase.
To exit from MQSC shell just type end and hit return.
Step 5: Starting MQ Listener
Finally we need to start a MQ listener for the queue manager to communicate with outside world, MQ listener can be started by executing following command;
Description: Above command will start MQ listener for queue manager (-m) T24QM, on port (-p) 1415 and transport protocol will be used (t) TCP.
After creating Queue manager, Queues and starting listener, following components need to be deployed in jboss Application server.
1) wmq.jmsra.rar
2) tocfT24ra-ra.rar
3) tocfOFSmessage-ejb.jar
4) mq-ds.xml
5) t24-ds.xml
6) ibmmq-destinations-service.xml
7) BrowserWeb.War
8) netty-3.2.4.jar
Quick Guide to Jboss with MQ- Release R13.00 -Page 3 of 10 - (c) Temenos Systems 2013 05/07/2013
</connection-factories>
Ibmmq-destinations-service.xml
<server>
<mbean code="org.jboss.resource.deployment.AdminObject"
service=WASDestination,name=t24OFSQueue">
name="jboss.jca:-
<depends optional-attribute-name="RARName">
jboss.jca:service=RARDeployment,name='wmq.jmsra.rar'</depends>
<attribute name="JNDIName">queue/t24OFSQueue</attribute>
<attribute name="Type">javax.jms.Queue</attribute>
<attribute name="Properties">
baseQueueManagerName=T24QM
baseQueueName=t24OFSQueue
</attribute>
</mbean>
< mbean code="org.jboss.resource.deployment.AdminObject"
service=WASDestination,name=t24OFSReplyQueue">
<depends
name="jboss.jca:-
optional-attribute-name="RARName">
jboss.jca:service=RARDeployment,name='wmq.jmsra.rar'</depends>
Quick Guide to Jboss with MQ- Release R13.00 -Page 4 of 10 - (c) Temenos Systems 2013 05/07/2013
<attribute name="JNDIName">queue/t24OFSReplyQueue</attribute>
<attribute name="Type">javax.jms.Queue</attribute>
<attribute name="Properties">
baseQueueManagerName=T24QM
baseQueueName=t24OFSReplyQueue
</attribute>
</mbean>
</server>
Quick Guide to Jboss with MQ- Release R13.00 -Page 5 of 10 - (c) Temenos Systems 2013 05/07/2013
<activation-config-property-name>hostName</activation-config-property-name>
<activation-config-property-value>127.0.0.1</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>port</activation-config-property-name>
<activation-config-property-value>1415</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>queueManager</activation-config-property-name>
<activation-config-property-value>T24QM</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>
<container-transaction>
<method>
<ejb-name>OFSMessageMDB</ejb-name>
<method-name>*</method-name>
</method>
<!-- NotSupported|Supports|Required|RequiresNew|Mandatory|Never -->
<trans-attribute>Required</trans-attribute>
</container-transaction>
</ejb-jar>
Jboss.xml
Quick Guide to Jboss with MQ- Release R13.00 -Page 6 of 10 - (c) Temenos Systems 2013 05/07/2013
<connection-factories>
<tx-connection-factory>
<jndi-name>jca/t24ConnectionFactory</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>
Quick Guide to Jboss with MQ- Release R13.00 -Page 7 of 10 - (c) Temenos Systems 2013 05/07/2013
Test Configurations
We can verify configurations up to this point by putting messages on our t24OFSQueue and check whether OFSMessageMDB gets activated
and pos t message to T24 and see the response in t24OFSReplyQueue. We need to open a command prompt on system where MQ server is
installed and navigate to bin directory of Websphere_MQ_Install_Dir and apply following command but Ensure that jboss is in running state
and jbase_agent listening to port number 51164.
We can verify the response by this command amqsget.exe t24OFSReplyQueue from WebSphere_MQ_Install_Dir/bin directory.
Or follow the below steps
1) Navigate to WebSphere MQ Explorer.
2) Expand IBM Web sphere option in left pane .
3) Click on Queue Manager (T24QM) under that click on Queues option.
4) In right side pane select t24OFSReplyQueue and you can see the response in that.
You can also notice output on T24 jbase_agent screen if it is running in debug mode;
For Eg:
Jbase_agent p 51164 L2
Important Note:
Quick Guide to Jboss with MQ- Release R13.00 -Page 8 of 10 - (c) Temenos Systems 2013 05/07/2013
If this test passes we can simply deploy BrowserWeb.war defined in next step. If any exceptions occurred on this stage, we need to rectify the
problem before we move onto next step.
Jboss-web.xml
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
<resource-ref>
<res-ref-name>jca/t24ConnectionFactory</res-ref-name>
<res-type>com.temenos.tocf.t24ra.T24ConnectionFactory</res-type>
<jndi-name>java:jca/t24ConnectionFactory</jndi-name>
</resource-ref>
<resource-ref>
<res-ref-name>jms/jmsConnectionFactory</res-ref-name>
<res-type>javax.jms.ConnectionFactory</res-type>
<!--<jndi-name>java:/ConnectionFactory</jndi-name>-->
<jndi-name>java:wmq/myFC</jndi-name>
</resource-ref>
<resource-ref>
<res-ref-name>queue/t24OFSQueue</res-ref-name>
<res-type>javax.jms.Queue</res-type>
<jndi-name>queue/t24OFSQueue</jndi-name>
</resource-ref>
<resource-ref>
<res-ref-name>queue/t24OFSReplyQueue</res-ref-name>
<res-type>javax.jms.Queue</res-type>
<jndi-name>queue/t24OFSReplyQueue</jndi-name>
</resource-ref>
</jboss-web>
After configuring above component Start jboss (by clicking run.bat) and start jbase_ agent listening to port number specified in t24ds.xml
(jbase_agent p 51164) login to T24.
Quick Guide to Jboss with MQ- Release R13.00 -Page 9 of 10 - (c) Temenos Systems 2013 05/07/2013
Resources
Using WebSphere MQ Server with jBoss Application Server 4..
http://www.jboss.org/community/wiki/UsingWebSphereMQSeriesWithJBossASPart4
Quick Guide to Jboss with MQ- Release R13.00 -Page 10 of 10 - (c) Temenos Systems 2013 05/07/2013