WSO2 Message Broker未收到消息

时间:2015-05-06 18:10:35

标签: jms wso2 wso2esb messagebroker

我遵循了关于WSO2 ESB和WSO2 MB之间集成的官方文档。

https://docs.wso2.com/display/MB210/Integrating+WSO2+ESB

在我的WSO2 ESB 8.1.0上,我写了一个这样的简单代理:

<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="jobReplicaFeed"
       transports="https,http"
       statistics="disable"
       trace="disable"
       startOnLoad="true">
   <target>
      <inSequence>
         <log level="full"/>
         <send>
            <endpoint key="ReplicaFeedEndpoint"/>
         </send>
      </inSequence>
      <outSequence>
         <log level="full"/>
      </outSequence>
   </target>
   <description/>
</proxy>

其中ReplicaFeedEndpoint类似于以下linsting:

<endpoint xmlns="http://ws.apache.org/ns/synapse" name="ReplicaFeedEndpoint">
   <address uri="jms:/REPLICA_FEED?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory&java.naming.provider.url=repository/conf/jndi.properties&transport.jms.DestinationType=topic">
      <suspendOnFailure>
         <progressionFactor>1.0</progressionFactor>
      </suspendOnFailure>
      <markForSuspension>
         <retriesBeforeSuspension>0</retriesBeforeSuspension>
         <retryDelay>0</retryDelay>
      </markForSuspension>
   </address>
</endpoint>

这是我的jndi.properties:

connectionfactory.QueueConnectionFactory = amqp://admin:admin@clientID/carbon?brokerlist='tcp://myHost:5672'
connectionfactory.TopicConnectionFactory = amqp://admin:admin@clientID/carbon?brokerlist='tcp://myHost:5672'

topic.MioEvento = REPLICA_FEED

使用简单的REST客户端我正在尝试向代理发送消息,期望消息代理拦截该消息。 什么都没发生。此外,尝试不同的时间,我随机得到这个例外:

TID: [0] [ESB] [2015-05-06 19:55:16,503] ERROR  {org.apache.axis2.transport.jms.JMSOutTransportInfo} -  Couldn't locate the JMS destination REPLICA_FEED of type topic/ extracted from the URL jms:/REPLICA_FEED?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory&java.naming.provider.url=repository/conf/jndi.properties&transport.jms.DestinationType=topic/ {org.apache.axis2.transport.jms.JMSOutTransportInfo}
javax.naming.NameNotFoundException: dynamicQueues/REPLICA_FEED
at org.wso2.andes.jndi.ReadOnlyContext.lookup(ReadOnlyContext.java:271)
at javax.naming.InitialContext.lookup(InitialContext.java:411)
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:127)
at org.apache.axis2.transport.base.AbstractTransportSender.invoke(AbstractTransportSender.java:112)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
at org.apache.synapse.core.axis2.DynamicAxisOperation$DynamicOperationClient.send(DynamicAxisOperation.java:185)
at org.apache.synapse.core.axis2.DynamicAxisOperation$DynamicOperationClient.executeImpl(DynamicAxisOperation.java:167)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
at org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(Axis2FlexibleMEPClient.java:482)
at org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:59)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:338)
at org.apache.synapse.endpoints.AbstractEndpoint.send(AbstractEndpoint.java:333)
at org.apache.synapse.endpoints.AddressEndpoint.send(AddressEndpoint.java:59)
at org.apache.synapse.endpoints.IndirectEndpoint.send(IndirectEndpoint.java:54)
at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:97)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:77)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:47)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:131)
at org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:166)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:344)
at org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:385)
at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:183)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Threa

可能是什么问题? 感谢

1 个答案:

答案 0 :(得分:0)

在端点定义中,uri包含队列的JNDI条目,其中传输被定义为主题。

transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory 

应该是

transport.jms.ConnectionFactoryJNDIName=TopicConnectionFactory

您可以在以下有关WSO2 ESB和MB集成的文章中找到更多信息。

http://wso2.com/library/articles/2013/03/configuring-wso2-esb-wso2-message-broker/