简体   繁体   English

[RabbitMQ] [春季]如何获得最终交易所名称?

[英][RabbitMQ][Spring] How do I get access to the final exchange name?

For an Exchange-to-Exchange binding definintion 对于Exchange到Exchange的绑定定义

public class RabbitRecieveTest implements MessageListener {
@Override
    public void onMessage(Message message) {
    String firstExchange = message.getMessageProperties().getReceivedExchange();
}
}

returns the first exchange name. 返回第一个交易所名称。

Scenario: 场景:

Message published to firstExchange <---binding--->secondExchange<---binding---->someQueue<--- listener 消息发布到firstExchange <--- binding ---> secondExchange <--- binding ----> someQueue <---侦听器

I would like to get the name of the secondExchange. 我想获取secondExchange的名称。 Is there a way? 有办法吗?

否,无法获取此信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用springm stream rabbitmq的rabbitmq的当前交换和队列名称 - How to use current exchange and queue name of rabbitmq with spring cloud stream rabbitmq 如何在春季通过XML绑定交换以交换Rabbitmq - how to binding exchange to exchange for Rabbitmq in spring via xml (关于&#39;final&#39;的问题和)如何从JSTL中的Spring ModelMap访问&#39;myModels&#39;的列表对象内容? - (Question about 'final' and) How do I access the list object contents of 'myModels' from the Spring ModelMap in JSTL? 如何使用Spring Boot通过扇出交换在RabbitMQ上发布消息 - How to publish messages on RabbitMQ with fanout exchange using Spring Boot 如何在 Spring4 中将 convertAndSendToUser() 与外部代理(例如 RabbitMQ)一起使用? - How do I use convertAndSendToUser() with an external broker such as RabbitMQ in Spring4? Spring rabbitmq发送到动态绑定交换 - Spring rabbitmq send to exchange with dynamic binding Spring和AMQP RabbitMQ主题交换不起作用 - Spring and AMQP RabbitMQ topic exchange not working Spring Boot + RabbitMQ 消息在延迟交换时丢失 - Spring Boot + RabbitMQ messages lost on delayed exchange 检查rabbitmq中是否存在具有指定名称的Exchange - Check if the Exchange with a specified name exist in rabbitmq RabbitMQ 访问被拒绝在 Spring - RabbitMQ Access refused in Spring
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM