0
votes

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.

1
How many messages are you trying to send to the queue at an instance?Balasubramaniam
Approx. 1000 messagesChavi Gupta

1 Answers

0
votes

TimeoutException indicates that a user-initiated operation is taking longer than the operation timeout. This can happen due to network or other infrastructure delays also.

Check the value of the ServicePointManager.DefaultConnectionLimit property, as hitting this limit can also cause a TimeoutException.