0

我应该如何禁用自动创建的 amqp-gen 队列?在 Mule ActiveMQ 中,我获得了“disableTemporaryReplyToDestinations”属性,通过将其设置为“true”并执行单向交换模式,我能够实现异步消息传递。

现在有了 AMQP/RabbitMQ,情况就不同了,我确实有单向交换模式,但我没有任何属性可以从 MuleStudio 内部的组件端设置,告诉我禁用这些,我什至无法从 RabbitMQ 禁用它控制板。

如何禁用异步实现不需要的那些 tempQueue(在 AMQP 中称为 amqp-gen)?

这是我的测试 XML

<mule xmlns:amqp="http://www.mulesoft.org/schema/mule/amqp" xmlns:http="http://www.mulesoft.org/schema/mule/http"
    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="CE-3.3.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd 
http://www.mulesoft.org/schema/mule/amqp http://www.mulesoft.org/schema/mule/amqp/current/mule-amqp.xsd 
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 ">

 <amqp:connector name="AMQP_Connector" validateConnections="true" 
                    host="arbuzqorks" 
                    port="1111" 
                    fallbackAddresses="localhost:5672" 
                    doc:name="AMQP Connector"/>

    <flow name="rabbitmq_demoFlow1" doc:name="rabbitmq_demoFlow1">
        <http:inbound-endpoint exchange-pattern="one-way" host="localhost" port="8081" path="rabbitmq" doc:name="HTTP"/>
        <set-payload value="#['This is a test message that...']" doc:name="Setting payload"/>
        <amqp:outbound-endpoint  exchangeType="direct" responseTimeout="10000" doc:name="AMQP" connector-ref="AMQP_Connector" exchangeName="async-direct-test" exchangeDurable="true" queueDurable="true"/>
    </flow>
    <flow name="async-rabbitmqFlow1" doc:name="async-rabbitmqFlow1">
        <amqp:inbound-endpoint exchange-pattern="one-way" exchangeName="async-direct-test" exchangeDurable="true" queueDurable="true" responseTimeout="10000" connector-ref="AMQP_Connector" doc:name="AMQP"/>
        <byte-array-to-string-transformer doc:name="Byte Array to String"/>
        <set-payload value="#[payload + ' passed into the consumer flow']" doc:name="adding string to payload"/>
        <amqp:outbound-endpoint exchange-pattern="one-way" routingKey="test_response" exchangeType="direct" exchangeDurable="true" queueDurable="true" responseTimeout="10000" connector-ref="AMQP_Connector" doc:name="AMQP" exchangeName="async-direct-test"/>
    </flow>
    <flow name="async-rabbitmqFlow2" doc:name="async-rabbitmqFlow2">
        <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" path="asyncamqp" doc:name="HTTP"/>
        <component class="com.web.esb.component.AsyncMessageRequestorComponent" doc:name="Request AMQP Message"/>
    </flow>
</mule>
4

1 回答 1

1

您的“问题”与临时队列无关并试图禁用它们,但实际上是一种称为“私有队列”的功能(有关更多信息,请参阅文档)。

基本上,因为您没有命名您在 AMQP 入站和出站端点中声明的队列,RabbitMQ 将它们视为您的连接私有并为它们提供生成的名称。

使用该queueName属性在您的 AMQP 端点上配置队列名称,一切都会按您的意愿工作。

于 2013-09-18T15:10:53.070 回答