Update GetAzureQueueLength in azure queue scaler, to support different queue length strategies.#5875
Update GetAzureQueueLength in azure queue scaler, to support different queue length strategies.#5875zroubalik merged 1 commit intokedacore:mainfrom leodip:4478-add-queueLengthStrategy
Conversation
| }) | ||
|
|
||
| t.Run("Invalid base64 connection string", func(t *testing.T) { | ||
| length, err := GetAzureQueueLength(context.TODO(), kedav1alpha1.AuthPodIdentity{}, "DefaultEndpointsProtocol=https;AccountName=name;AccountKey=key==;EndpointSuffix=core.windows.net", "queueName", "", "", "") |
There was a problem hiding this comment.
|
Semgrep found 2 Consider to use well-defined context Ignore this finding from context-todo. |
pkg/scalers/azure/azure_queue.go
Outdated
| return int64(props.ApproximateMessagesCount()), nil | ||
| } | ||
|
|
||
| // Default strategy (visible + invisible messages) |
There was a problem hiding this comment.
As per kedacore/keda-docs#1406 (comment) I don't think default is a good name nor do we even use it here?
There was a problem hiding this comment.
Thanks, I have renamed it to 'all'.
JorTurFer
left a comment
There was a problem hiding this comment.
Looking good! Could you replace the magic string with a constant?
Thanks, hope the new commit makes it better. |
|
@leodip Can you fix merge conflicts please? |
|
@tomkerkhove I've squashed and rebased - conflicts should be solved now. |
|
/run-e2e azure |
…queueLengthStrategy Signed-off-by: Leonardo D'Ippolito <contact@leodip.com>
|
/run-e2e queue |
…queueLengthStrategy (kedacore#5875) Signed-off-by: Leonardo D'Ippolito <contact@leodip.com> Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl>
This PR is an attempt to solve #4478
It adds a new configuration option
queueLengthStrategyto the Azure Storage Queue scaler, where you can set the value ofdefaultorvisibleonly.default: Considers both visible and invisible messages.visibleonly: Uses Peek to count only visible messages. If the count of visible messages is 32 or higher, it falls back to the default strategy, counting both visible and invisible messages.visibleonlywill, in practice, use the previous behaviour, as before #4003 was merged.Docs PR: kedacore/keda-docs#1406.
I've created this change to the best of my ability. However, it hasn't been tested. I would appreciate if someone could help with testing, or giving directions on how to test.
Thanks!