Queue 在mule中使用rabbitmq将消息从一个队列传递到另一个队列时发生异常

Queue 在mule中使用rabbitmq将消息从一个队列传递到另一个队列时发生异常,queue,rabbitmq,mule,mule-studio,Queue,Rabbitmq,Mule,Mule Studio,我正在mule中运行一个流,其中包含3个队列(rabbitmq)。这是我的配置xml <mule xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:amqp="http://www.mulesoft.org/schema/mule/amqp" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:tracking="http://www.mulesoft.

我正在mule中运行一个流,其中包含3个队列(
rabbitmq
)。这是我的配置xml

<mule xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:amqp="http://www.mulesoft.org/schema/mule/amqp" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
    xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.1"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.mulesoft.org/schema/mule/amqp http://www.mulesoft.org/schema/mule/amqp/current/mule-amqp.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd">
    <amqp:connector name="AMQP_Connector1" validateConnections="true" fallbackAddresses="localhost:5672" doc:name="AMQP Connector1"/>
    <flow name="putToQueue1" doc:name="putToQueue1">
        <http:inbound-endpoint exchange-pattern="one-way" host="localhost" port="8081" path="message" doc:name="HTTP"/>
        <set-payload value="#[message.inboundProperties['msg']]" doc:name="Set Payload"/>        
            <processor-chain doc:name="Processor Chain">
                <amqp:outbound-endpoint queueName="test.queue1" responseTimeout="10000" doc:name="AMQP1" connector-ref="AMQP_Connector1"/>
                <custom-processor class="CustomProcessor" doc:name="Custom Processor"/>
                <amqp:outbound-endpoint queueName="test.queue2" responseTimeout="10000" doc:name="AMQP2" connector-ref="AMQP_Connector1"/>
                <custom-processor class="CustomProcessor" doc:name="Custom Processor"/>
                <amqp:outbound-endpoint queueName="test.queue3" responseTimeout="10000"  doc:name="AMQP3" connector-ref="AMQP_Connector1"/>
           </processor-chain>       
    </flow>
</mule>
当我点击浏览器中的url(使用http端点)时,1条消息通过
queue1
queue2
传递到
queue3
。首先,将消息放入
queue1
,然后将其传输到
queue2
,然后将
queue2
传输到
queue3
。 将消息传输到其他队列后,前一个队列不应保留该消息。 但是当我第二次点击网址时。我得到下面的例外

Caused by: java.lang.LinkageError: loader (instance of  org/mule/module/launcher/plugin/MulePluginsClassLoader): attempted  duplicate class definition for name: "org/mule/transport/amqp/AmqpMuleMessageFactory"
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(Unknown Source)
    ..............

您试图做的是重新创建已经存在的队列。 将其视为服务器上有
queue1
,然后再次尝试创建此队列。RabbitMQ不知道这是一个错误还是您明确希望这样做。 在第二种情况下,创建队列时需要传递
被动
标志

请看这里:

位被动

如果已设置,则如果队列已经存在,服务器将使用Declare Ok进行回复 以相同的名称存在,如果不是,则引发错误。客户可以 使用此选项检查队列是否存在,而不修改服务器 状态设置后,除name和no wait之外的所有其他方法字段都将被删除 忽略。同时具有被动和无等待的声明无效。 对参数进行语义等价性比较


可能是一些版本特定的问题或配置详细信息?在Centos 6.4上的Studio 3.5.0中,我无法重现这个异常,没有Maven。
Caused by: java.lang.LinkageError: loader (instance of  org/mule/module/launcher/plugin/MulePluginsClassLoader): attempted  duplicate class definition for name: "org/mule/transport/amqp/AmqpMuleMessageFactory"
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(Unknown Source)
    ..............