您正在使用WSO2 ESB 4.7.0
我创建了一个代理,它监听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& java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616"/>
</endpoint>
</send>
<property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/>
<log level="full"/>
</inSequence>
</target>
</proxy>
根据进程,它应该从DLQ.kumar读取消息并将该消息放入kumar,但是它正在读取来自DLQ.kumar的消息并且未能将它放在kumar中。
我的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
谢谢!
答案 0 :(得分:0)
您是否通过在$ ESB_HOME / repository / conf / axis2 / axis2.xml文件中取消注释以下配置来配置JMS Transport Sender?如果没有,请配置它并重新启动ESB。
<transportSender name="jms" class="org.apache.axis2.transport.jms.JMSSender"/>
答案 1 :(得分:0)
<endpoint>
<address uri="jms:/dynamicQueues/kumar?transport.jms.ConnectionFactoryJNDIName=KumarQueueConnectionFactory&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616&transport.jms.DestinationType=queue/>
</endpoint>
或者您将连接工厂定义为axis2.xml并使用此uri:jms:/dynamicQueues/kumar?transport.jms.ConnectionFactory=myQueueConnectionFactory