How can I set the `accurate` scalingStrategy for Container App Jobs?

Byron Saltysiak 5 Reputation points
2024-05-31T21:15:22.4766667+00:00

I'm using a ServiceBus to broker messages that will require us to spawn a ContainerApp Job execution for each message. However, I'm having trouble finding the proper configuration.

Specifically, I see that there should be a scalingStrategy of accurate which the KEDA documentation says to use if (like us) your queue does not include locked messages:

"accurate If the scaler returns queueLength (number of items in the queue) that does not include the number of locked messages, this strategy is recommended. Azure Storage Queue is one example. You can use this strategy if you delete a message once your app consumes it."

Since we are running long executions so we are using Receive-and-Delete mode instead of Peek-Lock on our ServiceBus, so we fall into this category where we are deleting the message as soon as we consume it.But I'm not seeing any option to set scalingStrategy within the documentation related to Azure ServiceBus scalers, nor in the Azure documentation.

Has anyone figured out how to set this?

Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
635 questions
Azure Container Apps
Azure Container Apps
An Azure service that provides a general-purpose, serverless container platform.
444 questions
Azure Startups
Azure Startups
Azure: A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.Startups: Companies that are in their initial stages of business and typically developing a business model and seeking financing.
382 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Saif Badran 86 Reputation points Microsoft Employee
    2024-09-18T11:35:42.0433333+00:00

    <Answering here for public visibility>

    As you mentioned, the platform is using the ‘default’ scaling strategy, which handles ‘locked’ messages. Currently, there is no option for the customers to select different scaling strategies.

    A workaround to ensure your job processes messages reliably would be using the visibility timeout feature to lock the message. Adjust the timeout based on your job’s duration. For example, if your job usually takes 5 to 30 minutes, consider setting the visibility timeout to 1 hour. Once your code finishes processing the message, it can safely delete it.

    You can use QueueClient.UpdateMessage method to change visibility timeout.

    Note: The product team is planning to expose scaling strategy as an option to customers, but there is no ETA yet.

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.