-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
RabbitMQ scaler is watching the number of Ready instead of Total number of messages #5050
Comments
Hi, As this can't be fixed, I close this issue as not planned. If you think that the SDK supports somehow this feature (it could be, the SDKs grow and we can't track all of them), just comment the issue and I'll reopen it |
I see, but I suggest two changes though:
|
@krisowski sounds reasonable, are you willing to contribute that suggestion? thanks |
@zroubalik I can contribute but where do I find the docs? It looks like it's not part of this repo |
Report
When the RabbitMQ scaler is configured with the
amqp
protocol it is watching the number of Ready and not the Total number of messages as the code and docs suggest.The number of messages is taken from the
QueueDeclarePassive
API here: https://github.com/kedacore/keda/blob/main/pkg/scalers/rabbitmq_scaler.go#L491-L496. Unfortunately, this API returns the number of Ready messages, excluding the unacked ones, and not the total number of them according to the docs here: https://www.rabbitmq.com/dotnet-api-guide.html#passive-declarationThe
items.Messages
variable name suggests that this is the total number of messages but should be calleditems.MessagesReady
. However, changing that doesn't solve the issue. There should be another way of getting the number of total messages by using theamqp
protocol. I'm not sure if there is such methodExpected Behavior
The RabbitMQ scaler with the
amqp
configuration should return the number of Total messages in the queue and not the number of Ready messages.I also believe, that if there was a way to get both, Ready and Total, by using the
amqp
protocol then theexcludeUnacknowledged
option could albo be supported with theamqp
protocol and not with thehttp
onlyActual Behavior
KEDA autoscaling doesn't work as expected.
Let's say it is configured with the
QueueLength
andvalue
set to1
.The number of messages in the queue "now":
Number of Total messages (ready+unacked): 50
Number of Unacked messages: 40 (the messages are being processed now)
Number of Ready messages: 10 (waiting for processing)
Number of running pods/consumers: 40
Result: no more pods are spawned even though there are 10 messages waiting and only 40 pods running. KEDA doesn't add more pods before it thinks there are more pods than pending messages.
Steps to Reproduce the Problem
mode: QueueLength
andvalue: 1
Logs from KEDA operator
KEDA Version
2.11.0
Kubernetes Version
1.24
Platform
Google Cloud
Scaler Details
RabbitMQ
Anything else?
This issue exists also in the latest version.
The text was updated successfully, but these errors were encountered: