[英]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.