I’m seeing some odd connectivity (presumably) issues with ASB after my handler is run successfully and I’m unable to track down the root cause (or workarounds). This causes (in my opinion) unnecessary retries.
Basically I have a simple handler that sends out emails using SMTP. Email is sent out fine, but later it still fails with the exception:
Microsoft.Azure.ServiceBus.ServiceBusException: 'sender23' is closed
at Microsoft.Azure.ServiceBus.Core.MessageReceiver.DisposeMessagesAsync(IEnumerable`1 lockTokens, Outcome outcome)
at Microsoft.Azure.ServiceBus.RetryPolicy.RunOperation(Func`1 operation, TimeSpan operationTimeout)
at Microsoft.Azure.ServiceBus.RetryPolicy.RunOperation(Func`1 operation, TimeSpan operationTimeout)
at Microsoft.Azure.ServiceBus.Core.MessageReceiver.CompleteAsync(IEnumerable`1 lockTokens)
at NServiceBus.Transport.AzureServiceBus.MessagePump.ProcessMessage(Task`1 receiveTask)
This causes the message to be retried and email will be sent out again.
And I’m not been able to figure out why this happens or what can I do about it. And I noticed same exception in another endpoint also, which uses the same ASB namespace. Message processing time is minimal, under 300ms. So I don’t suspect any locking issues with messages.
I’m using NServiceBus 7.1.6 and NServiceBus.Transport.AzureServiceBus 1.0.0, application is dotnet core console application which runs on Windows.