我正在阅读this文章,它说在fanout
以外的消息交换中,消息被路由到与其键匹配的队列。
如果这是真的,那么为什么在以下注释中有两个参数(value
的{{1}}和@Queue
)?仅指定队列名称还不够吗?
key
另一个问题:有了您为听众看到的注释,我是否需要有一个单独的@RabbitListener(bindings = @QueueBinding(value = @Queue(value = RabbitMQConfiguration.AUTHENTICATION_EMAILS_QUEUE, durable = "true"), exchange = @Exchange(value = RabbitMQConfiguration.EMAIL_MESSAGE_EXCHANGE_NAME), key = "accountActivationEmail"))
public void receiveMessage(Map<String, String> message) {
this.sendEmail(getEmail(message));
}
类来指定@Configuration
,MessageListenerAdapter
,SimpleMessageListenerContainer
,{{ 1}},Binding
,如下所示:
Exchange