将 AMQP 与 ActiveMQ 结合使用会更改 JmsDestination header

Using AMQP with ActiveMQ changes the JmsDestination header

从今天开始,我们使用带有默认 JMS 和 "org.apache.camel.component.jms.JmsComponent" 的 Camel 和 ActiveMQ。当使用像 "myJmsComponent:queue:myqueue" 这样的 queue 时,"JmsDestination" header 包含 "myqueue".

现在我们想使用 AMQP 代替 "org.apache.camel.component.amqp.AMQPComponent"。 当使用 queue 和 "myAmqpComponent:queue:myqueue" 时,消息的 "JmsDestination" header 不再包含 "myqueue",而是动态系统名称,例如 "org.apache.qpid.amqp_1_0.jms.impl.QueueImpl@718762d8" ,我们在别处找不到 queue 名称。

在这种情况下我们如何检索 queue 名称?

似乎您使用的是旧版本,它从 Qpid 中引入了现已弃用的 AMQP 1.0 JMS 客户端,因此我建议使用更新的版本,使用受支持的 Qpid JMS 客户端。

您显示的输出似乎是代码只是在 Message 返回的 Destination 实例上执行 toString,而该对象没有实现正确的 toString,因此您获得了默认值。您应该使用返回的目标类型(队列或主题)中的 getQueueName 或 getTopicName。