有没有办法在使用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。因此,如果路由密钥上的交换或队列有任何问题,您将返回带有错误的消息