When the consumer is set to exclusive and multiple instances are started, the console continuously outputs info level restart consumers log.
When setting consumers as exclusive and bound, the restart log level for other consumers should be TRACE or DEBUG.
https://github.com/zhangheng0027/testRabbitMQ.git
@RabbitListener(
bindings = @QueueBinding(
value = @Queue(value = "test2Queue"),
exchange = @Exchange(value = "testExchange"),
key = "test2"
),
concurrency = "1",
exclusive = true,
ackMode = "MANUAL",
containerFactory = "batchListenerContainerFactory"
)
@SneakyThrows
public void test(@Payload List<Message<EquipmentStatusChangeEvent>> event, Channel channel) {
}
@RabbitListener(
bindings = @QueueBinding(
value = @Queue(value = "test2Queue"),
exchange = @Exchange(value = "testExchange"),
key = "test2"
),
concurrency = "1",
exclusive = true,
ackMode = "MANUAL",
containerFactory = "batchListenerContainerFactory"
)
@SneakyThrows
public void test2(@Payload List<Message<EquipmentStatusChangeEvent>> event, Channel channel) {
}
2023-09-28T17:11:57.492+08:00 WARN 21016 --- [ntContainer#1-1] o.s.a.r.l.SimpleMessageListenerContainer : Exclusive consumer failure: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=403, reply-text=ACCESS_REFUSED - queue 'test2Queue' in vhost '/test' in exclusive use, class-id=60, method-id=20)
2023-09-28T17:11:57.498+08:00 INFO 21016 --- [ntContainer#1-1] o.s.a.r.l.SimpleMessageListenerContainer : Restarting Consumer@43982337: tags=[[]], channel=Cached Rabbit Channel: AMQChannel(amqp://oee@192.168.115.248:4626//test,2), conn: Proxy@42fb8c87 Shared Rabbit Connection: SimpleConnection@5a50d9fc [delegate=amqp://oee@192.168.115.248:4626//test, localPort=9562], acknowledgeMode=MANUAL local queue size=0
2023-09-28T17:11:57.508+08:00 INFO 21016 --- [68.115.248:4626] o.s.a.r.c.CachingConnectionFactory : Shutdown Signal: channel error; protocol method: #method<channel.close>(reply-code=403, reply-text=ACCESS_REFUSED - queue 'test2Queue' in vhost '/test' in exclusive use, class-id=60, method-id=20)
When the consumer is set to exclusive and multiple instances are started, the console continuously outputs info level restart consumers log.
When setting consumers as exclusive and bound, the restart log level for other consumers should be TRACE or DEBUG.
https://github.com/zhangheng0027/testRabbitMQ.git