gpt4 book ai didi

jms - WS02 Websphere MQ 的 JMS 传输

转载 作者:行者123 更新时间:2023-12-02 03:01:44 25 4
gpt4 key购买 nike

经过几天的寻找,我在使用来自 IBM MQ 的消息时遇到了问题。我按照文档进行操作,但系统仍然无法正常工作。我正在使用 4.8.0 和 MQ 7.5.0.2

错误

[2014-02-06 01:06:14,341] ERROR - JMSListener Unable to continue server startup as it seems the JMS Provider is not yet started. Please start the JMS provider now.
[2014-02-06 01:06:14,342] ERROR - JMSListener Connection attempt : 1 for JMS Provider failed. Next retry in 20 seconds
[2014-02-06 01:06:34,364] ERROR - JMSListener Unable to continue server startup as it seems the JMS Provider is not yet started. Please start the JMS provider now.
[2014-02-06 01:06:34,365] ERROR - JMSListener Connection attempt : 2 for JMS Provider failed. Next retry in 40 seconds

root@sandbox:/opt/wso2esb-4.8.0/FFDC# more JMSCC0001.FDC
----------------------------------START FFST------------------------------------
/opt/wso2esb-4.8.0/FFDC/JMSCC0001.FDC PID:5897

JMS Common Client First Failure Symptom Report


Product :- IBM WebSphere MQ classes for JMS
Date/Time :- Thu Feb 06 00:54:07 CET 2014
System time :- 1391644447539
Operating System :- SunOS
UserID :- root
Java Vendor :- Oracle Corporation
Java Version :- 23.3-b01

Source Class :- com.ibm.mq.jms.MQQueueConnectionFactory
Source Method :- readObject()
ProbeID :- XF001003
Thread :- name=localhost-startStop-1 priority=5 group=main ccl=org.eclipse.core.runtime.internal.adaptor.ContextFinder@1da36ad

轴2配置

<transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
<parameter name="default" locked="false">
<parameter name="java.naming.factory.initial" locked="false">com.sun.jndi.fscontext.RefFSContextFactory</parameter>
<parameter name="java.naming.provider.url" locked="false">file:///var/tmp/jndi</parameter>
<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">ivtQCF</parameter>
<parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
<parameter name="transport.jms.Destination" locked="false">ivtQ</parameter>
</parameter>
</transportReceiver>

测试 jndi 是否正常工作

java JmsJndiConsumer -i file:///var/tmp/jndi -c ivtQCF -d ivtQ
Initial context found!
Received message:

JMSMessage class: jms_text
JMSType: null
JMSDeliveryMode: 2
JMSExpiration: 0
JMSPriority: 4
JMSMessageID: ID:414d5120514d412020202020202020204424ee5203db0020
JMSTimestamp: 1391646438379
JMSCorrelationID: null
JMSDestination: queue://QMA/QUEUE1
JMSReplyTo: null
JMSRedelivered: false
JMSXAppID: JmsJndiProducer
JMSXDeliveryCount: 1
JMSXUserID: webservd
JMS_IBM_Character_Set: UTF-8
JMS_IBM_Encoding: 273
JMS_IBM_Format: MQSTR
JMS_IBM_MsgType: 8
JMS_IBM_PutApplType: 28
JMS_IBM_PutDate: 20140206
JMS_IBM_PutTime: 00271840
JmsJndiProducer: Your lucky number today is 324

代理

<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="StockQuoteProxy2"
transports="jms"
startOnLoad="true"
trace="disable">
<description/>
<target>
<endpoint>
<address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
</endpoint>
<inSequence>
<property name="OUT_ONLY" value="true"/>
</inSequence>
<outSequence>
<send/>
</outSequence>
</target>
<publishWSDL uri="file:repository/samples/resources/proxy/sample_proxy_1.wsdl"/>
<parameter name="transport.jms.ContentType">
<rules>
<jmsProperty>contentType</jmsProperty>
<default>application/xml</default>
</rules>
</parameter>
</proxy>

我检查了网络,但看不到 esb 到 mq 服务器的任何连接。

有什么想法吗?

更新

我已使用完全相同的 jms 传输(默认)在示例 ($WSO2_HOME/samples/axis2Server/repository/conf/axis2.xml) 中配置了轴服务器。

编译“SimpleStockQuoteService”并启动服务器后,我可以看到它工作正常。

cd wso2esb-4.8.1/samples/axis2Server/src/SimpleStockQuoteService/ && ant
cd wso2esb-4.8.1/samples/axis2Server/ && ./axis2server.sh

14/02/10 21:20:29 INFO jms.JMSListener: JMS listener started
14/02/10 21:20:30 INFO jms.JMSListener: Connection attempt: 1 for JMS Provider for
service: SimpleStockQuoteService was successful!
14/02/10 21:20:30 INFO jms.ServiceTaskManager: Task manager for service :
SimpleStockQuoteService [re-]initialized
14/02/10 21:20:31 INFO jms.JMSListener: Started to listen on destination : ivtQ of
type queue for service SimpleStockQuoteService
14/02/10 21:20:31 INFO util.SampleAxis2ServerManager: [SimpleAxisServer] Started

我还是不明白为什么在碳内部不起作用!!!

最佳答案

我发现让它工作的唯一方法是修改启动脚本(ws02server.sh)以将 MQ 客户端 java 库添加到类路径

CARBON_CLASSPATH=/opt/mqm/java/lib/com.ibm.mq.jar:/opt/mqm/java/lib/com.ibm.mqjms.jar:"$CARBON_CLASSPATH"

如果 MQ 传输类型为 BIND(ws02 与 MQ 服务器位于同一服务器上),还需要包含 JNI 库 (-Djava.library.path=/opt/mqm/java/lib)

按照文档中所述将 MQ java 库复制到 repository/component/lib 不起作用。

在 Solaris 和 RHEL7 上使用 MQ 7.5.0.2 和 ws02 4.8.1 进行测试

关于jms - WS02 Websphere MQ 的 JMS 传输,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21591800/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com