【RabbitMQ】Java发送监听消息

 

写在一起

import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;

@RabbitListener(bindings = @QueueBinding(
        value = @Queue(value = "my_queue", durable = "true", autoDelete = "false"),
        exchange = @Exchange(value = "my_exchange", type = ExchangeTypes.TOPIC),
        key = "my_key"
))
public void appealSelectedCatId(String catId) {
}

 

posted @ 2022-09-09 22:57  翠微  阅读(193)  评论(0编辑  收藏  举报