简体   繁体   English

WS02用于Websphere MQ的JMS传输

[英]WS02 JMS transport for Websphere MQ

After looking for a couple of days I have the problem to consume message from IBM MQ. 在查看了几天后,我遇到了从IBM MQ消费消息的问题。 I followed the documentation, but still, the system is not working fine. 我按照文档,但仍然,系统工作不正常。 I'm using 4.8.0 and MQ 7.5.0.2 我使用的是4.8.0和MQ 7.5.0.2

error 错误

[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

axis2 config axis2配置

<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>

test jndi is working 测试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

proxy 代理

<?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>

I've check the network and i cannot see any connecton form esb to mq server. 我检查网络,我看不到任何connecton格式esb到mq服务器。

Any idea ? 任何的想法 ?

update 更新

I have configured the axis server in the sample ($WSO2_HOME/samples/axis2Server/repository/conf/axis2.xml) with exactly the same jms transport (default). 我在示例中配置了轴服务器($ WSO2_HOME / samples / axis2Server / repository / conf / axis2.xml),具有完全相同的jms传输(默认)。

Atfer compiling the 'SimpleStockQuoteService' and starting the the server i can see that is working fine. 参考编译'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

I still not understand why is not working inside carbon !!! 我还是不明白为什么不在碳内工作!!!

The only way I found to made it work is to modify the startup script (ws02server.sh) to add the MQ client java library to the classpath 我发现使其工作的唯一方法是修改启动脚本(ws02server.sh)以将MQ客户端Java库添加到类路径

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

If MQ transport type is BIND (ws02 on the same server as the MQ server) the JNI library need also to be included ( -Djava.library.path=/opt/mqm/java/lib ) 如果MQ传输类型是BIND(与MQ服务器在同一服务器上的ws02),则还需要包含JNI库( -Djava.library.path=/opt/mqm/java/lib

Copying the MQ java library to the repository/component/lib as stated in the documentation is not working. 如文档中所述将MQ java库复制到repository/component/lib不起作用。

Tested with MQ 7.5.0.2 and ws02 4.8.1 on Solaris and RHEL7 在Solaris和RHEL7上使用MQ 7.5.0.2和ws02 4.8.1进行了测试

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM