Azure / azure-functions-servicebus-extension

Service Bus extension for Azure Functions
MIT License
65 stars 35 forks source link

Message Processing Order Across Service Bus Queues #113

Closed SamNutkins closed 2 years ago

SamNutkins commented 3 years ago

I have a single Azure Function app containing multiple ServiceBusTrigger functions, each responding to messages from different queues. I do some throughput limiting using the maxConcurrentCalls and scale limiting (on the Function App itself) to limit load on downstream resources. Because of this, messages are sometimes waiting in queue for a period of time.

In this scenario, how does the function host determine which queues' messages to process first? For example, Queue A receives 10 messages. The function app begins processing them. Then Queue B receives 10 messages. Will Queue B's messages only be processed once Queue A's are fully processed? Or is it done in a round robin fashion?

Any insight or documentation references appreciated - thanks in advance.

alrod commented 2 years ago

@SamNutkinsPM360, Function host have 2 different listeners for Queue A and Queue B and the queues will be processed concurrently. So for 2 queues you concurrency will be maxConcurrentCalls * 2

ghost commented 2 years ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.