private static final Logger LOGGER = LoggerFactory.getLogger(MultiConsumer.class);
    private static final String TOPIC_EXCHANGE = "topicExchange1";
    private static final String ROUTING_KEY = "topic.unique.key";

    @RabbitListener(
            bindings =
                    {
                            @QueueBinding(
                                    value = @Queue(value = "topicQueue", durable = "true", exclusive = "false", autoDelete = "false"),
                                    exchange = @Exchange(value = TOPIC_EXCHANGE, type = ExchangeTypes.TOPIC), key = ROUTING_KEY),
                            @QueueBinding(
                                    value = @Queue(value = "topicQueue12", durable = "true", exclusive = "false", autoDelete = "false"),
                                    exchange = @Exchange(value = TOPIC_EXCHANGE, type = ExchangeTypes.TOPIC), key = ROUTING_KEY)
                    })
    public void dealMsg(String msg) {
        LOGGER.info("收到到消息:{}", msg);
    }

相关文章:

  • 2022-02-28
  • 2021-08-08
  • 2022-12-23
  • 2022-12-23
  • 2021-08-20
  • 2021-10-22
猜你喜欢
  • 2021-12-01
  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
相关资源
相似解决方案