Setup: 3 node cluster of rabbitmq nodes(via docker), behind ha-proxy.
Version:
- RabbitMQ: 3.8.11
- Erlang: 23.2.3
- Spring-amqp: 1.7.3
Spring-boot(1.5.4) app with 3 queues.
- defined as "exclusive", durable, auto-delete is false
- defined as "SAC", durable, auto-delete is false
- classic, durable, auto-delete is false
Policy:
Scenario:
- When application starts at first, queues are registered correctly.
- I bring down any node at random, if it is master node, the mirroring is triggered and one of the mirrored node becomes master.All fine so far.
- When I bring that node up, it is when I start to get exceptions in the application logs:
Logs:
Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=404, reply-text=NOT_FOUND - failed to perform operation on queue 'single-active-consumer-message-queue' in vhost '/dev' due to timeout, class-id=50, method-id=10)
at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:66) ~[amqp-client-4.0.2.jar!/:4.0.2]
at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:32) ~[amqp-client-4.0.2.jar!/:4.0.2]
at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:366) ~[amqp-client-4.0.2.jar!/:4.0.2]
at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:229) ~[amqp-client-4.0.2.jar!/:4.0.2]
at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:117) ~[amqp-client-4.0.2.jar!/:4.0.2]
... 25 common frames omitted
It attempts to reconnect for 3 times then eventually prints the log below
2021-03-18 17:08:55.487 ERROR 1 --- [cTaskExecutor-4] o.s.a.r.l.SimpleMessageListenerContainer : Stopping container from aborted consumer
2021-03-18 17:08:55.487 INFO 1 --- [cTaskExecutor-4] o.s.a.r.l.SimpleMessageListenerContainer : Waiting for workers to finish.
2021-03-18 17:08:55.487 INFO 1 --- [cTaskExecutor-4] o.s.a.r.l.SimpleMessageListenerContainer : Successfully waited for workers to finish.
On the RabbitMQ Console i see this:
CachingConnectionFactory is defined with basic connection details of the ha-proxy
@Bean
protected SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory(ConnectionFactory connectionFactory, RetryOperationsInterceptor retryAdvice) {
SimpleRabbitListenerContainerFactory containerFactory = new SimpleRabbitListenerContainerFactory();
containerFactory.setConnectionFactory(connectionFactory);
containerFactory.setDefaultRequeueRejected(false);
containerFactory.setAdviceChain(retryAdvice);
containerFactory.setMessageConverter(new Jackson2JsonMessageConverter());
return containerFactory;
}

