![](/img/trans.png)
[英]Configuring multiple queues with a topic exchange and using routing key to direct the message specific queue with spring cloud streams
[英]Validate exchange, routing key when publishing message using Spring RabbitMessagingTemplate
使用RabbitMessagingTemplate發送消息時,是否可以驗證交換和路由鍵/隊列? 當前,有一個默認的交換和路由密鑰,該密鑰為空字符串,並且不會引發任何錯誤。
messagingTemplate.convertAndSend(message.getExchange(), message.getRoutingKey(), message.getPayload());
請參閱“返回並確認”回調: https : //docs.spring.io/spring-amqp/docs/2.1.2.RELEASE/reference/html/_reference.html#template-confirms 。 因此,如果路由鍵上的交換或隊列有任何問題,您將收到一條錯誤返回的消息
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.