I am trying to schedule some messages to service bus queue in parallel with different scheduling intervals for each message. I have several chains of messages and I'm scheduling these chains in parallel and every message within these chains are also scheduled in parallel. But intermittently I see the TimeoutException occurring for few of the chains.
The number of chains executed in parallel are around 100 with each having ~ 100-150 messages. Retries for Service Bus operations are already implemented. Have already gone through all the TimeoutException articles but nothing concrete could be found to resolve this issue.
Here is my code:
Task<Guid[]> result = Task.WhenAll(queueTasks);
try
{
var jobIds = await ExecuteWithRetryAsync(async () =>
{
return await result.ConfigureAwait(false);
}).ConfigureAwait(false);
queuedJobIds = jobIds.ToList();
}
catch(TimeoutException ex)
{
_logger.LogError(ex, "Queueing failed.");
}
Any help or suggestions around this would be appreciated. Thanks.