How does the maxMessageCount work in service bus trigger?

80 Views Asked by At

In the official document there is a binding that seems to control to number of message sent to the function when triggered at one time. enter image description here

Let say maxMessageCount = 5, and there are 10 messages in the queue. Is it working like the first 5 messages trigger the function, and as soon as the function receive them, the next 5 trigger the second time? Or will the function wait for the first 5 messages to be completed, then to process the next 5 messages?

Another question: Let say maxMessageCount = 5 and maxConcurrentCalls = 1. Is there any interval between each batch got processed?

1

There are 1 best solutions below

10
Sean Feldman On

When invoked, this is the maximum number of messages the Function will receive in a batch. The function will continue to be triggered as long as messages are not locked (leased) and are active. If your function is configured for concurrent executions, it will get invoked concurrently with different batches without awaiting other batches' completion. Note that the maximum number of messages is not the exact number of messages a batch will contain.