【问题标题】:Message Driven Bean not consuming message after being deployed correctly正确部署后消息驱动 Bean 不使用消息
【发布时间】:2016-09-28 20:39:58
【问题描述】:

我已正确部署 mdb,服务器日志显示我已成功部署,但我仍然无法在 jboss 容器中使用来自 websphere mq 的消息

我的 mdb 中的激活配置

@MessageDriven(
    activationConfig = { 
        @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
        @ActivationConfigProperty(propertyName = "hostName", propertyValue = "ip_address"),
        @ActivationConfigProperty(propertyName = "port", propertyValue = "port"),
        @ActivationConfigProperty(propertyName = "channel", propertyValue = "JAVA.CHANNEL"),
        @ActivationConfigProperty(propertyName = "destination", propertyValue = "Q_PVF_BACKEND"),
        @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
        @ActivationConfigProperty(propertyName = "queueManager", propertyValue = "TEST_MRIS_IIB")
    })
@ResourceAdapter(value="wmq.jmsra.rar")

Jboss 服务器日志

08:40:38,188 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "ikvEAR.ear"
08:40:38,192 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "ikvEJB.jar"
08:40:38,208 INFO  [org.jboss.as.ejb3] (MSC service thread 1-2) JBAS014142: Started message driven bean 'mdb' with 'wmq.jmsra' resource adapter
08:40:38,277 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "ikvEAR.ear"

独立完整的.xml

    ...
         <mdb>
              <resource-adapter-ref resource-adapter-name="wmq.jmsra.rar"/>
              <bean-instance-pool-ref pool-name="mdb-wmq-strict-max-pool"/>
        </mdb>
...
 <subsystem xmlns="urn:jboss:domain:resource-adapters:1.0">
            <resource-adapters>
                <resource-adapter>
                    <archive>
                        wmq.jmsra.rar
                    </archive>
                    <transaction-support>NoTransaction</transaction-support>
                    <config-property name="logWriterEnabled">
                        true
                    </config-property>
                    <config-property name="traceLevel">
                        6
                    </config-property>
                    <config-property name="traceEnabled">
                        true
                    </config-property>
                    <connection-definitions>
                        <connection-definition class-name="com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl" jndi-name="java:/jboss/PVFConnectionFactory" pool-name="PVFConnectionFactory">
                            <config-property name="port">
                                port
                            </config-property>
                            <config-property name="channel">
                                SYSTEM.DEF.SVRCONN
                            </config-property>
                            <config-property name="hostName">
                                ip_address
                            </config-property>
                            <config-property name="transportType">
                                CLIENT
                            </config-property>
                            <config-property name="queueManager">
                                TEST_MRIS_IIB
                            </config-property>
                        </connection-definition>
                    </connection-definitions>
                    <admin-objects>
                        <admin-object class-name="com.ibm.mq.connector.outbound.MQQueueProxy" jndi-name="java:/jboss/jobQueue" pool-name="jobQueue">
                            <config-property name="baseQueueManagerName">
                                TEST_MRIS_IIB
                            </config-property>
                            <config-property name="baseQueueName">
                                Q_MRES_PSDS_ALL_MSG
                            </config-property>
                        </admin-object>
                        <admin-object class-name="com.ibm.mq.connector.outbound.MQQueueProxy" jndi-name="java:/jboss/backendQueue" pool-name="backendQueue">
                            <config-property name="baseQueueManagerName">
                                TEST_MRIS_IIB
                            </config-property>
                            <config-property name="baseQueueName">
                                Q_PVF_BACKEND
                            </config-property>
                        </admin-object>
                    </admin-objects>
                </resource-adapter>
            </resource-adapters>
        </subsystem>

【问题讨论】:

    标签: java linux jboss ibm-mq jboss-mdb


    【解决方案1】:

    您可能需要命名您的资源适配器:

            <subsystem xmlns="urn:jboss:domain:resource-adapters:1.1">
            <resource-adapters>
                <resource-adapter id="wmq.jmsra.rar">
                    <archive>
                        wmq.jmsra.rar
                    </archive>
    

    我很困惑:

    Started message driven bean 'mdb' with 'wmq.jmsra' resource adapter
    

    所有资源适配器的名称都应为“wmq.jmsra.rar”。 JBoss Web UI 上的部署页面是否显示了您的 IBM MQ 资源适配器?

    【讨论】:

    • 我命名了我的资源适配器,但我仍然无法使用来自 Websphere mq 的消息。 Started message driven bean 'mdb' with 'wmq.jmsra' resource adapter 这只是这个 mdb 与这个资源适配器一起部署的信息。
    猜你喜欢
    • 2015-05-13
    • 1970-01-01
    • 1970-01-01
    • 2013-05-16
    • 2011-07-15
    • 1970-01-01
    • 1970-01-01
    • 2012-07-21
    • 2017-06-13
    相关资源
    最近更新 更多