Reputation: 52
I have created a ScaledObject that scales Celery worker pods based on how many requests are present in a RabbitMQ queue. This is in an Azure Kubernetes Service cluster.
I used the the following url and noticed that the Unacknowledged messages are not included in the criteria that decide to scale up the Celery pods. It does work for the Ready messages, but these disappear rather quickly, leaving a bad indication if the pods should scale up.
amqp://user:[email protected]:5672
In this KEDA tutorial it says:
excludeUnacknowledged - Set to true to specify that the QueueLength value should exclude unacknowledged messages (Ready messages only). (Values: true, false, Default: false, Optional, Only applies to hosts that use the http protocol)
And in this Github thread it is made clear as well that only the HTTP protocol contains the information about Unacknowledged messages for RabbitMQ:
The amqp protocol only exposes unacked messages, to include those you have to use the http mode which talks to the Management API instead.
So, I have done this by changing the url to:
http://user:[email protected]:15672
When I do this, I get the following error on my ScaledObject:
Warning KEDAScalerFailed 3m27s (x201 over 13m) keda-operator
error inspecting rabbitMQ:
error requesting rabbitMQ API status: 404 Not Found,
response: {"error":"Object Not Found","reason":"Not Found"},
from: http://user:[email protected]:15672/api/queues/%!F(MISSING)/celery
What I think that the problem with this is, is that when I integrated RabbitMQ, I changed the base-path of the Management url to /management
. This way I can access the Management dashboard via: FQDN/management/#/
instead of via: FQDN/#/
. When I try to add /management
to the back of the url though, it is seen as a vhost and pasted behind the /api/queues/
part like this:
http://user:[email protected]:15672/api/queues/management/celery
Is another way to retrieve the data of the Unacknowledged messages? Or is there a way to get /management/
inside of the url at the correct spot?
Keda version: 2.9.0, Kubernetes version: 1.24.10
Upvotes: 0
Views: 394
Reputation: 36
You can use %2g in the uri
Like this
http://user:[email protected]:15672/api/queues/%2f/management/celery
Upvotes: 0