简体   繁体   English

Wso2 ESB JMS使用ActiveMQ消耗并产生消息

[英]Wso2 esb JMS consume and produce message with ActiveMQ

Hi am working with WSO2 ESB 4.7.0 嗨,我正在使用WSO2 ESB 4.7.0

I have created a proxy which listens to a jms queue and consumes a message from that queue and place that in the other jms queue,below is the code of my proxy. 我创建了一个代理,它侦听一个jms队列并使用该队列中的消息,并将其放入另一个jms队列中,以下是我的代理的代码。

    <proxy xmlns="http://ws.apache.org/ns/synapse"
       name="DLQ.kumar"
       transports="jms"
       startOnLoad="true"
       trace="disable">
   <target>
      <inSequence>
         <property name="OUT_ONLY" value="true"/>
         <send>
            <endpoint>
                  <address uri="jms:/kumar?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&amp;  java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;java.naming.provider.url=tcp://localhost:61616"/>
               </endpoint>
         </send>
    <property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/>
         <log level="full"/>
      </inSequence>
   </target>
</proxy>

As per the process it should read the message from DLQ.kumar and place that message to kumar,But it is reading the messages from DLQ.kumar and failing to place it in the kumar. 按照该过程,它应该从DLQ.kumar中读取消息,然后将该消息放置到kumar中,但是它正在从DLQ.kumar中读取消息,并且无法将其放入kumar中。

My ESB is reflecting the flowing error 我的ESB反映了错误

    JMSUtils Cannot locate destination : Kumar
    [2015-08-04 13:09:51,265] ERROR - JMSOutTransportInfo Couldn't locate the JMS destination Kumar of type generic extracted from the URL jms:/Kumar?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&                 java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616
    javax.naming.NameNotFoundException: Name [dynamicQueues/Kumar] is not bound in this Context. Unable to find [dynamicQueues].
        at org.apache.naming.NamingContext.lookup(NamingContext.java:820)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:168)
        at org.wso2.carbon.context.internal.CarbonContextDataHolder$CarbonInitialJNDIContext.lookup(CarbonContextDataHolder.java:1030)
        at javax.naming.InitialContext.lookup(InitialContext.java:409)
        at org.apache.axis2.transport.jms.JMSUtils.lookup(JMSUtils.java:583)
        at org.apache.axis2.transport.jms.JMSUtils.lookupDestination(JMSUtils.java:814)
        at org.apache.axis2.transport.jms.JMSOutTransportInfo.getDestination(JMSOutTransportInfo.java:184)
        at org.apache.axis2.transport.jms.JMSOutTransportInfo.loadConnectionFactoryFromProperties(JMSOutTransportInfo.java:132)
        at org.apache.axis2.transport.jms.JMSOutTransportInfo.createJMSSender(JMSOutTransportInfo.java:330)
        at org.apache.axis2.transport.jms.JMSSender.sendMessage(JMSSender.java:125)
        at org.apache.axis2.transport.base.AbstractTransportSender.invoke(AbstractTransportSender.java:112)
        at org.apache.axis2.engine.AxisEngine$TransportNonBlockingInvocationWorker.run(AxisEngine.java:626)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:701)
    [2015-08-04 13:09:51,266]  INFO - AxisEngine [MessageContext: logID=93b40feadaf9ce3b4ef4eb0952395ebbfd2b79b95d9bd0fa] Couldn't locate the JMS destination Kumar of type generic extracted from the URL jms:/Kumar?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&                 java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616
     INFO - AxisEngine [MessageContext: logID=93b40feadaf9ce3b4ef4eb0952395ebbfd2b79b95d9bd0fa] Couldn't locate the JMS destination Kumar of type generic extracted from the URL jms:/Kumar?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&                 java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616
[2015-08-04 13:09:51,266] ERROR - AsyncCallback Couldn't locate the JMS destination Kumar of type generic extracted from the URL jms:/Kumar?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&                 java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616
org.apache.axis2.transport.jms.AxisJMSException: Couldn't locate the JMS destination Kumar of type generic extracted from the URL jms:/Kumar?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&                 java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616
    at org.apache.axis2.transport.jms.JMSOutTransportInfo.handleException(JMSOutTransportInfo.java:250)
    at org.apache.axis2.transport.jms.JMSOutTransportInfo.getDestination(JMSOutTransportInfo.java:186)
    at org.apache.axis2.transport.jms.JMSOutTransportInfo.loadConnectionFactoryFromProperties(JMSOutTransportInfo.java:132)
    at org.apache.axis2.transport.jms.JMSOutTransportInfo.createJMSSender(JMSOutTransportInfo.java:330)
    at org.apache.axis2.transport.jms.JMSSender.sendMessage(JMSSender.java:125)
    at org.apache.axis2.transport.base.AbstractTransportSender.invoke(AbstractTransportSender.java:112)
    at org.apache.axis2.engine.AxisEngine$TransportNonBlockingInvocationWorker.run(AxisEngine.java:626)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:701)
Caused by: javax.naming.NameNotFoundException: Name [dynamicQueues/Kumar] is not bound in this Context. Unable to find [dynamicQueues].
    at org.apache.naming.NamingContext.lookup(NamingContext.java:820)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:168)
    at org.wso2.carbon.context.internal.CarbonContextDataHolder$CarbonInitialJNDIContext.lookup(CarbonContextDataHolder.java:1030)
    at javax.naming.InitialContext.lookup(InitialContext.java:409)
    at org.apache.axis2.transport.jms.JMSUtils.lookup(JMSUtils.java:583)
    at org.apache.axis2.transport.jms.JMSUtils.lookupDestination(JMSUtils.java:814)
    at org.apache.axis2.transport.jms.JMSOutTransportInfo.getDestination(JMSOutTransportInfo.java:184)
    ... 8 more
[2015-08-04 13:09:51,267]  WARN - AsyncCallback Executing fault handler due to exception encountered
[2015-08-04 13:09:51,267]  WARN - EndpointContext Endpoint : endpoint_b1b40feadaf9ce3b4767fa0952395ebba03b79b95d9bd0fa will be marked SUSPENDED as it failed

Thanks!! 谢谢!!

Have you configured JMS Transport Sender by uncommenting following configuration in $ESB_HOME/repository/conf/axis2/axis2.xml file? 您是否通过取消注释$ ESB_HOME / repository / conf / axis2 / axis2.xml文件中的以下配置来配置JMS Transport Sender? If not, please configure it and restart the ESB. 如果不是,请对其进行配置,然后重新启动ESB。

<transportSender name="jms" class="org.apache.axis2.transport.jms.JMSSender"/>
<endpoint>
     <address uri="jms:/dynamicQueues/kumar?transport.jms.ConnectionFactoryJNDIName=KumarQueueConnectionFactory&amp;java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;java.naming.provider.url=tcp://localhost:61616&amp;transport.jms.DestinationType=queue/>
</endpoint>

Or you define your connection factory into axis2.xml and use this uri : jms:/dynamicQueues/kumar?transport.jms.ConnectionFactory=myQueueConnectionFactory 或者,您将连接工厂定义为axis2.xml并使用此uri: jms:/dynamicQueues/kumar?transport.jms.ConnectionFactory=myQueueConnectionFactory

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

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