带有Rabbit MQ的WSO2 - 警告:EPR为NULL。传输配置可能不正确

时间:2015-06-30 12:55:18

标签: rabbitmq wso2esb

我使用RabbitMQ创建了一个代理,并在仪表板屏幕上显示了以下区域: 警告:EPR为NULL。传输配置可能不正确

这是我的配置:

    <?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="RabbitMqProxy"
       transports="rabbitmq"
       statistics="enable"
       trace="enable"
       startOnLoad="true">
   <target>
      <inSequence>
         <log level="full"/>
         <property name="OUT_ONLY" value="true"/>
         <property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/>
      </inSequence>
      <endpoint>
         <address uri="rabbitmq:/RabbitMqProxy?rabbitmq.server.host.name=199.53.215.101&amp;rabbitmq.server.port=5672&amp;rabbitmq.server.user.name=guest&amp;rabbitmq.server.password=guest&amp;rabbitmq.queue.name=intraday.oms.message;rabbitmq.exchange.name=test-topic"/>
      </endpoint>
   </target>
   <parameter name="rabbitmq.queue.name">intraday.oms.message</parameter>
   <parameter name="rabbitmq.server.virtual.host">/carbon</parameter>
   <parameter name="rabbitmq.connection.factory">AMQPConnectionFactory</parameter>
   <parameter name="rabbitmq.exchange.name">test-topic</parameter>
   <description/>
</proxy>

我无法确定错误但是当我按照Windows示例时,我无法在订阅方收到任何消息,这可能就是问题所在。

1 个答案:

答案 0 :(得分:0)

对于RabbitMQ,消费者rabbitmq.server.virtual.host不是代理参数,而是连接工厂的参数。

因此,您应该在axis2.xml中创建其他连接工厂:

<transportReceiver name="rabbitmq" class="org.apache.axis2.transport.rabbitmq.RabbitMQListener"‌​>
    <parameter name="AMQPConnectionFactory" locked="false">
        <parameter name="rabbitmq.server.host.name" locked="false">199.53.215.101</parameter>
        <parameter name="rabbitmq.server.port" locked="false">5672</parameter>
        <parameter name="rabbitmq.server.user.name" locked="false">guest</parameter>
        <parameter name="rabbitmq.server.password" locked="false">guest</parameter>
    </parameter> 
    <parameter name="AMQPConnectionFactoryCarbon" locked="false">
        <parameter name="rabbitmq.server.host.name" locked="false">199.53.215.101</parameter>
        <parameter name="rabbitmq.server.port" locked="false">5672</parameter>
        <parameter name="rabbitmq.server.virtual.host">/carbon</parameter>
        <parameter name="rabbitmq.server.user.name" locked="false">guest</parameter>
        <parameter name="rabbitmq.server.password" locked="false">guest</parameter>
    </parameter>
</transportReceiver>

并将代理的参数列表更改为以下内容:

<parameter name="rabbitmq.queue.name">intraday.oms.message</parameter>
<parameter name="rabbitmq.connection.factory">AMQPConnectionFactoryCarbon</parameter>
<parameter name="rabbitmq.exchange.name">test-topic</parameter>