I'm migrating my in process functions to isolated.
While migrating I'm having this difficulty:
It seems like ServiceBus's maxConcurrentCalls can only be set using host.json file.
{
"version": "2.0",
"extensions": {
"serviceBus": {
"clientRetryOptions":{
"mode": "exponential",
"tryTimeout": "00:01:00",
"delay": "00:00:00.80",
"maxDelay": "00:01:00",
"maxRetries": 3
},
"prefetchCount": 0,
"transportType": "amqpWebSockets",
"webProxy": "https://proxyserver:8080",
"autoCompleteMessages": true,
"maxAutoLockRenewalDuration": "00:05:00",
"maxConcurrentCalls": 16,
"maxConcurrentSessions": 8,
"maxMessageBatchSize": 1000,
"minMessageBatchSize": 1,
"maxBatchWaitTime": "00:00:30",
"sessionIdleTimeout": "00:01:00",
"enableCrossEntityTransactions": false
}
}
}
In the old process, in-process model, we were able handle the maxConcurrancy using appsettings.json
var serviceBusMaxConcurrentCalls =
Configuration.GetValue<int>("AppConfig:ServiceBus:Concurrency:MaxConcurrentCalls");
var serviceBusMaxConcurrentSessions =
Configuration.GetValue<int>("AppConfig:ServiceBus:Concurrency:MaxConcurrentSessions");
var serviceBusMaxConcurrentCallsPerSession =
Configuration.GetValue<int>("AppConfig:ServiceBus:Concurrency:MaxConcurrentCallsPerSession");
services.Configure<ServiceBusOptions>(options =>
{
options.MaxConcurrentCalls = serviceBusMaxConcurrentCalls;
options.MaxConcurrentSessions = serviceBusMaxConcurrentSessions;
options.MaxConcurrentCallsPerSession = serviceBusMaxConcurrentCallsPerSession;
options.AutoCompleteMessages = false;
}
);
Is there a way to still manage the concurrency using the appsettings? Or do we have to maintain an environment-specific host.json file?