【问题标题】:rabbitMQ message forwarding from one queue to anotherrabbitMQ 消息从一个队列转发到另一个队列
【发布时间】:2015-09-18 12:17:45
【问题描述】:

您能帮我解决我面临的问题吗?

当将消息从一个队列转发到另一个队列时(似乎没有消息被发布), 步骤:

  1. 定时器将当前日期发布到队列“收件箱”——这部分工作

  2. 从“收件箱”到“发件箱” - 这不起作用

  3. 从“发件箱”到打印控制台

遵循spring xml。

<route>
    <camel:from
        uri="rabbitmq://localhost:5672/outBox?sername=guest&amp;password=guest" />
    <camel:to uri="stream:out" />
</route>
<route>
    <camel:from
        uri="rabbitmq://localhost:5672/inbox?username=guest&amp;password=guest" />
    <camel:to
        uri="rabbitmq://localhost:5672/outBox?username=guest&amp;password=guest" />
</route>
<route>
    <camel:from uri="timer:foo?period=10" />

    <setBody>
        <simple>${body}Message at ${date:now:yyyy-MM-dd HH:mm:ss}</simple>
    </setBody>

    <to
        uri="rabbitmq://localhost:5672/inbox?username=guest&amp;password=guest" />
</route>

【问题讨论】:

    标签: apache-camel spring-rabbit


    【解决方案1】:

    根据http://camel.apache.org/rabbitmq.html的URI格式是

    rabbitmq://hostname[:port]/exchangeName?[options]
    

    因此,您的代码中的inbox 不是队列名称而是交换。 使用queue= 选项指定队列

    【讨论】: