此内容没有您所选择的语言版本。

22.8. Deploy the WebSphere MQ Resource Adapter


About WebSphere MQ

WebSphere MQ is IBM's Messaging Oriented Middleware (MOM) software that allows applications on distributed systems to communicate with each other. This is accomplished through the use of messages and message queues. WebSphere MQ is responsible for delivering messages to the message queues and for transferring data to other queue managers using message channels. For more information about WebSphere MQ, see WebSphere MQ.

Summary

This topic covers the steps to deploy and configure the WebSphere MQ Resource Adapter in Red Hat JBoss Enterprise Application Platform 6. This can be accomplished by manually editing configuration files, using the Management CLI tool, or using the web-based Management Console.

Note

There is a known issue in WebSphere MQ Resource Adapter version 7.5.0.3 and earlier that causes periodic recovery to fail with an XA exception with messages similar to the following in the JBoss EAP server log:
WARN  [com.arjuna.ats.jta] (Periodic Recovery) ARJUNA016027: Local XARecoveryModule.xaRecovery got XA exception XAException.XAER_INVAL: javax.transaction.xa.XAException: The method 'xa_recover' has failed with errorCode '-5'.
Copy to Clipboard Toggle word wrap
A fix is available in version 7.5.0.4. A detailed description of this issue can be found here: http://www-01.ibm.com/support/docview.wss?uid=swg1IC97579.
Be aware that WebSphere MQ 8.0 and above is not supported in EAP 6.x.
Prerequisites

Before you get started, you must verify the version of the WebSphere MQ resource adapter and understand some of the WebSphere MQ configuration properties.

  • The WebSphere MQ resource adapter is supplied as a Resource Archive (RAR) file called wmq.jmsra-VERSION.rar. You must use version 7.5.0.x. See the note above for information about the required version.
  • You must know the values of the following WebSphere MQ configuration properties. Refer to the WebSphere MQ product documentation for details about these properties.
    • MQ.QUEUE.MANAGER: The name of the WebSphere MQ queue manager
    • MQ.HOST.NAME: The host name used to connect to the WebSphere MQ queue manager
    • MQ.CHANNEL.NAME: The server channel used to connect to the WebSphere MQ queue manager
    • MQ.QUEUE.NAME: The name of the destination queue
    • MQ.TOPIC.NAME: The name of the destination topic
    • MQ.PORT: The port used to connect to the WebSphere MQ queue manager
    • MQ.CLIENT: The transport type
  • For outbound connections, you must also be familiar with the following configuration property:
    • MQ.CONNECTIONFACTORY.NAME: The name of the connection factory instance that will provide the connection to the remote system

Note

The following are default configurations provided by IBM and are subject to change. Please refer to WebSphere MQ documentation for more information.

Procedure 22.8. Deploy the Resource Adapter Manually

  1. Copy the wmq.jmsra-VERSION.rar file to the EAP_HOME/standalone/deployments/ directory.
  2. Add the resource adapter to the server configuration file.
    1. Open the EAP_HOME/standalone/configuration/standalone-full.xml file in an editor.
    2. Find the urn:jboss:domain:resource-adapters subsystem in the configuration file.
    3. If there are no resource adapters defined for this subsystem, first replace:
      <subsystem xmlns="urn:jboss:domain:resource-adapters:1.1"/>
      Copy to Clipboard Toggle word wrap
      with this:
      <subsystem xmlns="urn:jboss:domain:resource-adapters:1.1">
          <resource-adapters>
              <!-- <resource-adapter> configuration listed below -->
          </resource-adapters>
      </subsystem>
      Copy to Clipboard Toggle word wrap
    4. The resource adapter configuration depends on whether you need transaction support and recovery. If you do not need transaction support, choose the first configuration step below. If you do need transaction support, choose the second configuration step. In both examples, the config-property name elements are case sensitive, and must be entered as seen in the example.
      • For non-transactional deployments, replace the <!-- <resource-adapter> configuration listed below --> with the following:
        <resource-adapter>
            <archive>
                wmq.jmsra-VERSION.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">
                        MQ.HOST.NAME
                    </config-property>
                    <config-property name="port">
                        MQ.PORT
                    </config-property>
                    <config-property name="channel">
                        MQ.CHANNEL.NAME
                    </config-property>
                    <config-property name="transportType">
                        MQ.CLIENT
                    </config-property>
                    <config-property name="queueManager">
                        MQ.QUEUE.MANAGER
                    </config-property>
                    <security>
                        <security-domain>MySecurityDomain</security-domain>
                    </security>
               </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>
                    <config-property name="baseQueueManagerName">
                        MQ.QUEUE.MANAGER
                    </config-property>
               </admin-object>  
               <admin-object class-name="com.ibm.mq.connector.outbound.MQTopicProxy"
                        jndi-name="java:jboss/MQ.TOPIC.NAME" pool-name="MQ.TOPIC.NAME">
                    <config-property name="baseTopicName">
                        MQ.TOPIC.NAME
                    </config-property>
                    <config-property name="brokerPubQueueManager">
                        MQ.QUEUE.MANAGER
                    </config-property>
               </admin-object>
            </admin-objects>
        </resource-adapter>
        Copy to Clipboard Toggle word wrap
        Be sure to replace the VERSION with the actual version in the name of the RAR.
      • For transactional deployments, replace the <!-- <resource-adapter> configuration listed below --> with the following:
        <resource-adapter>
            <archive>
                wmq.jmsra-VERSION.rar
            </archive>
            <transaction-support>XATransaction</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">
                        MQ.HOST.NAME
                    </config-property>
                    <config-property name="port">
                        MQ.PORT
                    </config-property>
                    <config-property name="channel">
                        MQ.CHANNEL.NAME
                    </config-property>
                    <config-property name="transportType">
                        MQ.CLIENT
                    </config-property>
                    <config-property name="queueManager">
                        MQ.QUEUE.MANAGER
                    </config-property>
                   <security>
                        <security-domain>MySecurityDomain</security-domain>
                    </security>
                    <recovery>
                     <recover-credential>
                     	<security-domain>RECOVERY_SECURITY_DOMAIN</security-domain>
                     </recover-credential>
                    </recovery>
                </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>
                    <config-property name="baseQueueManagerName">
                        MQ.QUEUE.MANAGER
                    </config-property>
                </admin-object>
                <admin-object class-name="com.ibm.mq.connector.outbound.MQTopicProxy"
                        jndi-name="java:jboss/MQ.TOPIC.NAME" pool-name="MQ.TOPIC.NAME">
                    <config-property name="baseTopicName">
                        MQ.TOPIC.NAME
                    </config-property>
                    <config-property name="brokerPubQueueManager">
                        MQ.QUEUE.MANAGER
                    </config-property>
                </admin-object>
            </admin-objects>
        </resource-adapter>
        Copy to Clipboard Toggle word wrap
        Be sure to replace the VERSION with the actual version in the name of the RAR. You must also replace the USER_NAME and PASSWORD with the valid user name and password.

        Note

        To support transactions, the <transaction-support> element was set to XATransaction. To support XA recovery, the <recovery> element was added to the connection definition.
    5. If you want to change the default provider for the EJB3 messaging system in JBoss EAP 6 from HornetQ to WebSphere MQ, modify the urn:jboss:domain:ejb3:1.2 subsystem as follows:
      Replace:
      <mdb>
          <resource-adapter-ref resource-adapter-name="hornetq-ra"/>
          <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>
      </mdb>
      Copy to Clipboard Toggle word wrap
      with:
      <mdb>
          <resource-adapter-ref resource-adapter-name="wmq.jmsra-VERSION.rar"/>
          <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>
      </mdb>
      Copy to Clipboard Toggle word wrap
      Be sure to replace the VERSION with the actual version in the name of the RAR.

Procedure 22.9. Modify the MDB code to use the resource adapter

  • Configure the ActivationConfigProperty and ResourceAdapter in the MDB code as shown below. All of the propertyName elements are case sensitive, and must be entered as seen below.
    @MessageDriven(name="WebSphereMQMDB", activationConfig = {
        @ActivationConfigProperty(propertyName = "destinationType",propertyValue = "javax.jms.Queue"),
        @ActivationConfigProperty(propertyName = "useJNDI", propertyValue = "false"),
        @ActivationConfigProperty(propertyName = "hostName", propertyValue = "MQ.HOST.NAME"),
        @ActivationConfigProperty(propertyName = "port", propertyValue = "MQ.PORT"),
        @ActivationConfigProperty(propertyName = "channel", propertyValue = "MQ.CHANNEL.NAME"),
        @ActivationConfigProperty(propertyName = "queueManager", propertyValue = "MQ.QUEUE.MANAGER"),
        @ActivationConfigProperty(propertyName = "destination", propertyValue = "MQ.QUEUE.NAME"),
        @ActivationConfigProperty(propertyName = "transportType", propertyValue = "MQ.CLIENT")
    })
    
    @ResourceAdapter(value = "wmq.jmsra-VERSION.rar")
    @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
    public class WebSphereMQMDB implements MessageListener {
    }
    Copy to Clipboard Toggle word wrap
    Be sure to replace the VERSION with the actual version in the name of the RAR.
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat