I receive a message from Service Bus in ReceiveAndDelete mode and start running a very long computational process which after completion sends a mail. I have error logging in all my methods in my long running method. However the method runs for 10-15 minutes and becomes unresponsive after that neither it logs an error not it sends an email. I wonder it could be something to do with the TTL of the message.
Please advise what should I do?
private static async Task ProcessMessagesAsync(Message message, CancellationToken token)
{
try
{
IQueueClient queueClient = new QueueClient(serviceBusConnectionString, serviceBusQueueName, ReceiveMode.ReceiveAndDelete);
var receivedMessageTrasactionId = Convert.ToInt64(Encoding.UTF8.GetString(message.Body));
// Very Long Running Method
await DataCleanse.PerformDataCleanse(receivedMessageTrasactionId);
// to avoid unnecessary exceptions.
}
catch (Exception ex)
{
Log4NetErrorLogger(ex);
throw ex;
}
}