Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Management UI reports two consumers as active on a QQ with x-single-active-consumer #13045

Open
zachary-jiang opened this issue Jan 10, 2025 · 7 comments

Comments

@zachary-jiang
Copy link

zachary-jiang commented Jan 10, 2025

Describe the bug

Rabbit MQ Version: 4.0.5

When using RabbitMQ's x-single-active-consumer feature, the management UI shows all connected consumers with the status "single active" under the Activity status column. However, this is misleading because only one consumer is actually active and receiving messages, while the others are in a standby state, waiting to take over if the active consumer disconnects or fails.

This behavior is intentional and works as designed for the x-single-active-consumer feature, ensuring only one active consumer processes messages at a time. However, the UI does not differentiate between the active consumer and the standby consumers, which can cause confusion for users.

19BD6523-1830-4e42-BCA8-054F7FC7E819

Reproduction steps

1.Run the following command to publish 5000 messages to a quorum queue named qq-sac with the x-single-active-consumer feature enabled:
java -jar perf-test.jar --uri amqp://guest:[email protected]:5672 --quorum-queue --queue qq-sac --pmessages 5000 --confirm 100 -qa x-single-active-consumer=true --consumers 0
Start a consumer with default priority (prefetch 1000, consumption rate ~10 msgs/sec):

2.Start a consumer with default priority and a prefetch count of 1000:
java -jar perf-test.jar --uri amqp://guest:[email protected]:5672 --producers 0 --predeclared --queue qq-sac --consumer-latency 100000 --qos 1000
Start a second consumer with higher priority:

3.Start another consumer on the same queue, but with a higher priority (x-priority=10):
java -jar perf-test.jar --uri amqp://guest:[email protected]:5672 --producers 0 --predeclared --queue qq-sac --consumer-latency 100000 --qos 1000 --consumer-args x-priority=10
Observation:

4.In RabbitMQ's management UI, both consumers will be displayed as having the "single active" status under Activity status, even though only one consumer is actively consuming messages, while the other is in standby mode.
This leads to confusion as the UI does not differentiate the active consumer from the standby consumers.

Expected behavior

The UI should clearly indicate which consumer is active and which ones are in a standby state when the x-single-active-consumer feature is enabled.

Additional context

No response

@michaelklishin
Copy link
Member

I'm pretty sure I have seen it work as expected a month or two ago (I do not need to use SAC very often to develop RabbitMQ itself).

Thank you for the steps to reproduce with PerfTest, we'll try to reproduce.

@zachary-jiang
Copy link
Author

zachary-jiang commented Jan 13, 2025

I'm pretty sure I have seen it work as expected a month or two ago (I do not need to use SAC very often to develop RabbitMQ itself).

Thank you for the steps to reproduce with PerfTest, we'll try to reproduce.

Thank you for looking into this! I appreciate your help.If you need any additional details, feel free to ask. I'm happy to assist.

@michaelklishin
Copy link
Member

#13063

@michaelklishin
Copy link
Member

4.1.0-alpha.a9e972f5 includes #13063, a 4.0.x alpha build will follow later today under Releases in the same repo, rabbitmq/server-packages.

@michaelklishin michaelklishin added this to the 4.0.6 milestone Jan 13, 2025
@zachary-jiang
Copy link
Author

zachary-jiang commented Jan 14, 2025

无标题

image

#13063 is not the same as this issue. I have recovered it in [4.1.0-alpha.a9e972f5], but the problem still persists. The two consumers remain in the single active state, and the status shown in the management UI does not match the command line results.

@michaelklishin michaelklishin removed this from the 4.0.6 milestone Jan 14, 2025
@michaelklishin
Copy link
Member

@zachary-jiang then we need an executable way to reproduce, with PerfTest, Stream PerfTest or a small application.

@michaelklishin michaelklishin changed the title RabbitMQ Management UI Does Not Differentiate Active and Standby Consumers with x-single-active-consumer Feature Management UI reports two consumers as active on a QQ with x-single-active-consumer Jan 14, 2025
@zachary-jiang
Copy link
Author

zachary-jiang commented Jan 14, 2025

Issue Reproduction Using Perf-Test

I used perf-test to reproduce this issue. Below are the detailed steps:


1. Publish 5000 Messages to a Quorum Queue Named qq-sac with x-single-active-consumer Enabled

Run the following command to publish 5000 messages:

java -jar perf-test.jar --uri amqp://{{username}}:{{passwd}}@{{mqhost}}:{{port}} --quorum-queue --queue qq-sac --pmessages 5000 --confirm 100 -qa x-single-active-consumer=true --consumers 0


2. Start Consumer A with Priority 5, Prefetch Count of 640, and Consumer Latency of 10000 ms

Run the following command to start Consumer A:

java -jar perf-test.jar --uri amqp://{{username}}:{{passwd}}@{{mqhost}}:{{port}} --producers 0 --predeclared --queue qq-sac --consumer-latency 10000 --qos 640 --consumer-args x-priority=5


3. Start Consumer B with Higher Priority (x-priority=10)

Run the following command to start Consumer B:

java -jar perf-test.jar --uri amqp://{{username}}:{{passwd}}@{{mqhost}}:{{port}} --producers 0 --predeclared --queue qq-sac --consumer-latency 1000 --qos 1000 --consumer-args x-priority=10


Behavior Observation

  • Consumer A consumes messages at a rate of 64 messages/second.

  • With a prefetch count of 640, it takes approximately 10 seconds for Consumer A to process all prefetched messages.

  • When Consumer B starts, it will begin receiving messages after Consumer A finishes consuming its prefetched messages (after 10 seconds).

  • When Consumer B starts receiving messages, refresh the queue UI. You will see both Consumer A and Consumer B listed as single-active in the Activity Status column under the Consumers properties.


Placeholder Explanation

  • Replace {{username}} and {{passwd}} with the actual RabbitMQ username and password.

  • Replace {{mqhost}} and {{port}} with the RabbitMQ host address and port.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants