@Test @SneakyThrows public void process() { Thread.sleep(1 * 1000); for (int i = 0; i < 1000; i++) { rabbitTemplate.convertAndSend(RabbitMQConstant.NONE_EXCHANGE, RabbitMQConstant.NONE_KEY, new ExampleEvent(id.getAndIncrement(), "auto message ")); } Thread.sleep(100 * 1000); }
@RabbitListener( bindings = @QueueBinding( exchange = @Exchange(value = RabbitMQConstant.NONE_EXCHANGE, type = ExchangeTypes.TOPIC), value = @Queue(value = RabbitMQConstant.NONE_QUEUE, durable = RabbitMQConstant.TURE_CONSTANT), key = RabbitMQConstant.NONE_KEY ), containerFactory = "containerWithNone" ) @SneakyThrows public void process(@Headers Map<String, Object> headers, @Payload ExampleEvent msg) { Thread.sleep(1 * 1000); log.info("none consumer receive message:{headers = [" + headers + "], msg = [" + msg + "]}"); }
CunsumerWithNone { @RabbitListener( bindings = @QueueBinding( exchange = @Exchange(value = RabbitMQConstant.NONE_EXCHANGE, type = ExchangeTypes.TOPIC), value = @Queue(value = RabbitMQConstant.NONE_QUEUE, durable = RabbitMQConstant.TURE_CONSTANT), key = RabbitMQConstant.NONE_KEY ), containerFactory = "containerWithNone" ) @SneakyThrows public void process(@Headers Map<String, Object> headers, @Payload ExampleEvent msg) { Thread.sleep(1 * 1000); log.info("none consumer receive message:{headers = [" + headers + "], msg = [" + msg + "]}"); } }
CunsumerWithNone { @RabbitListener( bindings = @QueueBinding( exchange = @Exchange(value = RabbitMQConstant.NONE_EXCHANGE, type = ExchangeTypes.TOPIC), value = @Queue(value = RabbitMQConstant.NONE_QUEUE, durable = RabbitMQConstant.TURE_CONSTANT), key = RabbitMQConstant.NONE_KEY ), containerFactory = "containerWithNone" ) @SneakyThrows public void process(@Headers Map<String, Object> headers, @Payload ExampleEvent msg) { Thread.sleep(1 * 1000); log.info("none consumer receive message:{headers = [" + headers + "], msg = [" + msg + "]}"); }  }
CunsumerWithNone { @RabbitListener( bindings = @QueueBinding( exchange = @Exchange(value = RabbitMQConstant.NONE_EXCHANGE, type = ExchangeTypes.TOPIC), value = @Queue(value = RabbitMQConstant.NONE_QUEUE, durable = RabbitMQConstant.TURE_CONSTANT), key = RabbitMQConstant.NONE_KEY ), containerFactory = "containerWithNone" ) @SneakyThrows public void process(@Headers Map<String, Object> headers, @Payload ExampleEvent msg) { Thread.sleep(1 * 1000); log.info("none consumer receive message:{headers = [" + headers + "], msg = [" + msg + "]}"); }  @RabbitListener( bindings = @QueueBinding( exchange = @Exchange(value = RabbitMQConstant.NONE_EXCHANGE, type = ExchangeTypes.TOPIC), value = @Queue(value = RabbitMQConstant.NONE_QUEUE, durable = RabbitMQConstant.TURE_CONSTANT), key = RabbitMQConstant.NONE_KEY ), containerFactory = "containerWithNone" ) @SneakyThrows void process(@Headers Map<String, Object> headers, @Payload ExampleEvent msg); }
CunsumerWithNone { @RabbitListener( bindings = @QueueBinding( exchange = @Exchange(value = RabbitMQConstant.NONE_EXCHANGE, type = ExchangeTypes.TOPIC), value = @Queue(value = RabbitMQConstant.NONE_QUEUE, durable = RabbitMQConstant.TURE_CONSTANT), key = RabbitMQConstant.NONE_KEY ), containerFactory = "containerWithNone" ) @SneakyThrows public void process(@Headers Map<String, Object> headers, @Payload ExampleEvent msg) { Thread.sleep(1 * 1000); log.info("none consumer receive message:{headers = [" + headers + "], msg = [" + msg + "]}"); }  @RabbitListener( bindings = @QueueBinding( exchange = @Exchange(value = RabbitMQConstant.NONE_EXCHANGE, type = ExchangeTypes.TOPIC), value = @Queue(value = RabbitMQConstant.NONE_QUEUE, durable = RabbitMQConstant.TURE_CONSTANT), key = RabbitMQConstant.NONE_KEY ), containerFactory = "containerWithNone" ) @SneakyThrows void process(@Headers Map<String, Object> headers, @Payload ExampleEvent msg);  }