Connecting JBOSS to MQ using ResourceAdapter

Configuring JBOSS to MQ is pretty easy . Just follow below steps
1.Download wmq.jmsra.rar from IBM site or copy from from MQ server .
2.Install wmq.jmsra.rar on JBOSS as an application and the runtime name wmq.jmsra.rar will be configured in resource-adapter tag.
3.Resource adapter config looks like the below for connection to MQ QMGR .it should be configured in domain.xml for Domain mode setup and in standalone.xml for standalone setup.
4.Application internally uses JNDI names that configured under resource-adapter for communication with the QUEUE’s or TOPIC’s . If we have multiple queues then we will get multiple queue and relevent jndi names to be update in the xml file .

With No resource-adapter xml content looks like below

<subsystem xmlns="urn:jboss:domain:resource-adapters:1.0"/>

with resource adapter below is the skelton

<subsystem xmlns="urn:jboss:domain:resource-adapters:1.0">
    <resource-adapters>
        <!-- <resource-adapter> configuration listed below -->
    </resource-adapters>
</subsystem>
<resource-adapters>
                <resource-adapter id="wmq.jmsra.rar">
                    <archive>
                        wmq.jmsra.rar
                    </archive>
                    <transaction-support>NoTransaction</transaction-support>
                    <connection-definitions>
                        <connection-definition class-name="com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl" jndi-name="java:jboss/MQ.CONNECTIONFACTORY.NAME" pool-name="MQ.CONNECTIONFACTORY.NAME">
                            <config-property name="hostName">
                                mqhot.localhost
                            </config-property>
                            <config-property name="queueManager">
                                MQ.QUEUE.MANAGER
                            </config-property>
                            <config-property name="port">
                                1414
                            </config-property>
                            <config-property name="channel">
                                TEST.SVRCONN
                            </config-property>
                            <config-property name="transportType">
                                CLIENT
                            </config-property>
                            <config-property name="sslCipherSuite">
                                TLS_RSA_WITH_AES_128_CBC_SHA
                            </config-property>
                            <config-property name="username">
                                mquser
                            </config-property>
                        </connection-definition>
                    </connection-definitions>
            <admin-objects>
                <admin-object 
                        class-name="com.ibm.mq.connector.outbound.MQQueueProxy" 
                        jndi-name="java:jboss/MQ.QUEUE.NAME" 
                        pool-name="MQ.QUEUE.NAME">
                    <config-property name="baseQueueName">
                        MQ.QUEUE.NAME
                    </config-property>
                </admin-object>
            </admin-objects>
</resource-adapter>

5.Deploy orginal Application and test the MQ connectivity . Check the logs for any error’s .

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *