1
votes

I have a Durable orchestration client which is Service Bus Topic triggered.

[FunctionName("ServiceBusTrigger")]
        public static async Task ServiceBusTrigger(
            [ServiceBusTrigger("topicname", "subscriptionname", Connection = "MyServiceBusKey")]string mySbMsg,
            [OrchestrationClient]DurableOrchestrationClient starter,
            ILogger log)
        {
            string instanceId = await starter.StartNewAsync("Orchestrator", mySbMsg);

            log.LogInformation($"Started orchestration with ID = '{instanceId}'.");

        }

Does enabling the prefetch count under extensions in host.json cause messages to be prefetched in the Service Bus Trigger?

host.json:

{
    "version": "2.0",
    "extensions": {
        "serviceBus": {
            "prefetchCount": 100
        }
    }
}
1

1 Answers

5
votes

Does enabling the prefetch count under extensions in host.json cause messages to be prefetched in the Service Bus Trigger?

Prefetch count affects the maximum number of messages prefetched by the underlying MessageReceiver used by Azure Functions SDK. You will have to ensure that prefetchCount is configured properly with the value defined for maxConcurrentCalls to ensure not too many messages are pre-fetched and locks are lost while waiting for processing.