Single active consumer Issue. All messages in queue disappear when the active consumer dies

284 views
Skip to first unread message

devansh arora

unread,
Feb 26, 2020, 2:45:41 AM2/26/20
to rabbitmq-users
Hello,

I am using SAC for a queue in my application. I deploy two instances of my application. Hence two consumers get attached to the SAC.
One remains single active and the other  is waiting.
But when i stop the application instance whose consumer was in active mode, all the messages are getting disappeared from the queue(all ready, unack and total)
I am creating consumers using apache camel routes.

Wesley Peng

unread,
Feb 26, 2020, 2:57:12 AM2/26/20
to rabbitm...@googlegroups.com
When new messages can't be routed to a queue they will be dropped by the broker.

Regards.

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/4702d610-4078-4f9c-bba7-2ffd47c1ef08%40googlegroups.com.

Wesley Peng

unread,
Feb 26, 2020, 2:58:28 AM2/26/20
to rabbitm...@googlegroups.com
What I said is you could please make sure after consumer dropped the connection the queues are still keep declared.

Thanks.

On Wed, Feb 26, 2020 at 3:45 PM devansh arora <devansh...@gmail.com> wrote:
--

devansh arora

unread,
Feb 26, 2020, 3:50:36 AM2/26/20
to rabbitmq-users
Hello Wesley,

The queue is durable, hence the messages should remain in the queue. Right?
In my case the queue remains alive, but all the messages and the waiting consumers also disappears.


On Wednesday, February 26, 2020 at 1:28:28 PM UTC+5:30, Wesley Peng wrote:
What I said is you could please make sure after consumer dropped the connection the queues are still keep declared.

Thanks.

On Wed, Feb 26, 2020 at 3:45 PM devansh arora <devansh...@gmail.com> wrote:
Hello,

I am using SAC for a queue in my application. I deploy two instances of my application. Hence two consumers get attached to the SAC.
One remains single active and the other  is waiting.
But when i stop the application instance whose consumer was in active mode, all the messages are getting disappeared from the queue(all ready, unack and total)
I am creating consumers using apache camel routes.

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitm...@googlegroups.com.

Wesley Peng

unread,
Feb 26, 2020, 3:52:51 AM2/26/20
to rabbitm...@googlegroups.com
what's rabbitmq and erlang versions you are using with?

Regards.

To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/5d1525fd-043b-4954-bcd5-799ee317b526%40googlegroups.com.

devansh arora

unread,
Feb 26, 2020, 3:56:31 AM2/26/20
to rabbitmq-users
Rabbitmq 3.8.0
Erlang 22.1


On Wednesday, February 26, 2020 at 2:22:51 PM UTC+5:30, Wesley Peng wrote:
what's rabbitmq and erlang versions you are using with?

Regards.

On Wed, Feb 26, 2020 at 4:50 PM devansh arora <devansh...@gmail.com> wrote:
Hello Wesley,

The queue is durable, hence the messages should remain in the queue. Right?
In my case the queue remains alive, but all the messages and the waiting consumers also disappears.


On Wednesday, February 26, 2020 at 1:28:28 PM UTC+5:30, Wesley Peng wrote:
What I said is you could please make sure after consumer dropped the connection the queues are still keep declared.

Thanks.

On Wed, Feb 26, 2020 at 3:45 PM devansh arora <devansh...@gmail.com> wrote:
Hello,

I am using SAC for a queue in my application. I deploy two instances of my application. Hence two consumers get attached to the SAC.
One remains single active and the other  is waiting.
But when i stop the application instance whose consumer was in active mode, all the messages are getting disappeared from the queue(all ready, unack and total)
I am creating consumers using apache camel routes.

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitm...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/4702d610-4078-4f9c-bba7-2ffd47c1ef08%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitm...@googlegroups.com.

devansh arora

unread,
Feb 26, 2020, 3:59:42 AM2/26/20
to rabbitmq-users

my Queue features are:

   x-max-priority:3
   x-single-active-consumer:true
   durable:true

Regards

Wesley Peng

unread,
Feb 26, 2020, 4:05:22 AM2/26/20
to rabbitm...@googlegroups.com
Hello

How did you check that all messages were disappeared? from rabbitmqctl?

regards.

To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/41d85c8b-a589-435a-b306-dc68ea63b6da%40googlegroups.com.

devansh arora

unread,
Feb 26, 2020, 4:10:43 AM2/26/20
to rabbitmq-users
I am checking it via Management UI. All the messages and waiting consumers disappear.

Regards.

Wesley Peng

unread,
Feb 26, 2020, 4:12:13 AM2/26/20
to rabbitm...@googlegroups.com
That would be possible bug in web interface.
Can you check them from rabbitmqctl?

Regards.

To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/d3052ba9-3824-4819-b11c-42eb7c8be6a0%40googlegroups.com.

Arnaud Cogoluègnes

unread,
Feb 26, 2020, 4:13:08 AM2/26/20
to rabbitm...@googlegroups.com
> The queue is durable, hence the messages should remain in the queue. Right?

The messages must also be published with delivery mode = 2 to be persistent.

devansh arora

unread,
Feb 26, 2020, 4:15:20 AM2/26/20
to rabbitmq-users
Ok Wesley. Will verify that

Regards

devansh arora

unread,
Feb 26, 2020, 4:18:50 AM2/26/20
to rabbitmq-users
Yes Arnaud,

I am using delivery mode =2. Also, the queue is not set to auto delete and also durable.

Arnaud Cogoluègnes

unread,
Feb 26, 2020, 5:16:01 AM2/26/20
to rabbitm...@googlegroups.com
I cannot reproduce. I tested with the following procedure:
- create a queue with the settings specified above
- start 2 instances of the same application. The application
registers a listener with explicit ack, qos = 2, and acks every other
message (this allows to have un-acked messages and messages to queue
up in the queue)
- send some messages, only the first instance receives the messages.
The management UI shows unacked messages and messages in the queue.
- stop the first instance.
- the second instance takes over and receives some messages. The
management UI shows the unacked messages and some remaining messages
in the queue.

I'm using RabbitMQ 3.8.2 and Erlang 22.2.6.

Could you provide some steps to reproduce (preferably without Camel,
with just a simple program using the Java client or something else)?
> --
> You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/d1c720fb-1fee-41be-b7ec-56f35be46cec%40googlegroups.com.

devansh arora

unread,
Feb 26, 2020, 5:27:40 AM2/26/20
to rabbitmq-users
Hey Wesley,

I got Zero messages or consumers using rabbitmqctl as well.
I verified with below command. 

rabbitmqctl list_queues -p myvhost name messages consumers

Regards

devansh arora

unread,
Feb 26, 2020, 5:30:25 AM2/26/20
to rabbitmq-users
Ok Arnaud, I will try with java client instead of apache camel.

I am currently using RabbitMQ  3.8.0 and Erlang 22.1.
Should i upgrade it as well? before testing with java client? is there any known issue related to this?


On Wednesday, February 26, 2020 at 3:46:01 PM UTC+5:30, Arnaud Cogoluègnes wrote:
I cannot reproduce. I tested with the following procedure:
  - create a queue with the settings specified above
  - start 2 instances of the same application. The application
registers a listener with explicit ack, qos = 2, and acks every other
message (this allows to have un-acked messages and messages to queue
up in the queue)
 - send some messages, only the first instance receives the messages.
The management UI shows unacked messages and messages in the queue.
 - stop the first instance.
 - the second instance takes over and receives some messages. The
management UI shows the unacked messages and some remaining messages
in the queue.

I'm using RabbitMQ 3.8.2 and Erlang 22.2.6.

Could you provide some steps to reproduce (preferably without Camel,
with just a simple program using the Java client or something else)?

On Wed, Feb 26, 2020 at 10:18 AM devansh arora <devansh...@gmail.com> wrote:
>
> Yes Arnaud,
>
> I am using delivery mode =2. Also, the queue is not set to auto delete and also durable.
>
> On Wednesday, February 26, 2020 at 2:43:08 PM UTC+5:30, Arnaud Cogoluègnes wrote:
>>
>> > The queue is durable, hence the messages should remain in the queue. Right?
>>
>> The messages must also be published with delivery mode = 2 to be persistent.
>
> --
> You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rabbitm...@googlegroups.com.

Arnaud Cogoluègnes

unread,
Feb 26, 2020, 5:40:25 AM2/26/20
to rabbitm...@googlegroups.com
Yes, you should upgrade both RabbitMQ and Erlang. I don't remember any
SAC-related fixes off the top of my head but it's always better to use
the latest versions. I'd advice to try to reproduce with the exact
same applications but with upgraded RabbitMQ and Erlang, and then try
to reproduce with the Java client with the upgraded versions as well
(don't change 2 parameters at the same time).
> To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/4cf4d375-747d-42ba-9490-06ef5d0590a2%40googlegroups.com.

devansh arora

unread,
Feb 26, 2020, 8:18:46 AM2/26/20
to rabbitmq-users
I also wanted to notify you that i am using x-delayed-message type queue and exchange here. And publishing messages with a delay of 1 second. Can this cause any issue when combined with SAC

Arnaud Cogoluègnes

unread,
Feb 26, 2020, 9:14:59 AM2/26/20
to rabbitm...@googlegroups.com
There's no such thing as "x-delayed-message type queue" AFAIK. An
x-delayed-message exchange should not affect SAC, but we never know.

Please provide some steps to reliably reproduce the issue, without
this we're just trying to guess what's going on.
> To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/70d73aa7-4134-4ead-91e1-be4f9655e90e%40googlegroups.com.

Luke Bakken

unread,
Feb 26, 2020, 11:19:51 AM2/26/20
to rabbitmq-users
The queue is durable, hence the messages should remain in the queue. Right?
In my case the queue remains alive, but all the messages and the waiting consumers also disappears.

"durable" only means that the queue will survive, not the messages.

Messages must be published with the "persistent" flag set.


Thanks -
Luke 

devansh arora

unread,
Feb 26, 2020, 11:39:24 AM2/26/20
to rabbitmq-users
Yes Luke. I am also setting the delivery mode=2 for persistent messages. The queue i created as durable to survive restarts with message persistence as well.

devansh arora

unread,
Feb 26, 2020, 11:52:43 AM2/26/20
to rabbitmq-users
Agree Arnaud.
Will share steps ..

devansh arora

unread,
Feb 27, 2020, 4:56:35 AM2/27/20
to rabbitmq-users
I tried with spring boot application and it seems to be working fine.
Below is the link of the sample I created to test using spring boot.


I will check again with apache camel to understand if it is causing the issue somewhere.

Thanks everyone. Arnaud, Wesley & Luke 

Michael Klishin

unread,
Feb 27, 2020, 10:51:58 AM2/27/20
to rabbitmq-users
On top of that, queues must be durable and non-autodelete or exclusive [1].

Reply all
Reply to author
Forward
0 new messages