I have four receivers set up doing long-polling on a Service Bus queue. Four receivers because the queue may receive a lot of messages that need to be processed quickly and so far, four is enough. The queue has been empty all weekend because
the sending process is currently disabled, but the receivers have been polling anyway. I receive intermittent "The server was unable to process the request due to an internal error" exceptions, and I'd like to fix this, if possible. Today I received
over 200 of these errors. Here's data and a stack trace from a typical one:
Microsoft.ServiceBus.Messaging.MessagingException, Microsoft.ServiceBus, Version=1.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
The server was unable to process the request due to an internal error.
TrackingId:44b2ffdd-77b9-428c-b580-edfbc0dc74d7_18, Timestamp:4/29/2012 9:07:26 PM
Server stack trace: at Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessageReceiver.EndReceiveCommand(IAsyncResult result, IEnumerable`1& messages) at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult
result) Exception rethrown at [0]: at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result) at Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessageReceiver.OnEndTryReceive(IAsyncResult result, IEnumerable`1&
messages) at Microsoft.ServiceBus.Messaging.MessageReceiver.TryReceive(TrackingContext trackingContext, Int32 messageCount, TimeSpan timeout, IEnumerable`1& messages) at Microsoft.ServiceBus.Messaging.MessageReceiver.Receive(TimeSpan
serverWaitTime) at
(my code) at
Microsoft.Practices.TransientFaultHandling.RetryPolicy.<>c__DisplayClass1.<ExecuteAction>b__0() at Microsoft.Practices.TransientFaultHandling.RetryPolicy.ExecuteAction[TResult](Func`1 func) at (my code)
Inner exception
System.ServiceModel.FaultException`1[[System.ServiceModel.ExceptionDetail, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
The server was unable to process the request due to an internal error.
TrackingId:44b2ffdd-77b9-428c-b580-edfbc0dc74d7_18, Timestamp:4/29/2012 9:07:26 PM
Server stack trace: at Microsoft.ServiceBus.Messaging.Sbmp.DuplexRequestBindingElement.DuplexRequestSessionChannel.ThrowIfFaultMessage(Message wcfMessage) at Microsoft.ServiceBus.Messaging.Sbmp.DuplexRequestBindingElement.DuplexRequestSessionChannel.HandleMessageReceived(IAsyncResult
result) Exception rethrown at [0]: at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result) at Microsoft.ServiceBus.Messaging.Sbmp.DuplexRequestBindingElement.DuplexRequestSessionChannel.DuplexCorrelationAsyncResult.End(IAsyncResult
result) at Microsoft.ServiceBus.Messaging.Channels.ReconnectBindingElement.ReconnectChannelFactory`1.RequestSessionChannel.RequestAsyncResult.<GetAsyncSteps>b__13(RequestAsyncResult thisPtr, IAsyncResult r) at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult
result) Exception rethrown at [1]: at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result) at Microsoft.ServiceBus.Messaging.Channels.ReconnectBindingElement.ReconnectChannelFactory`1.RequestSessionChannel.EndRequest(IAsyncResult
result) at Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessageReceiver.EndReceiveCommand(IAsyncResult result, IEnumerable`1& messages)
My code:
Uri serviceUri = ServiceBusEnvironment.CreateServiceUri("sb", serviceNamespace, servicePath);
TokenProvider tokenProvider = TokenProvider.CreateSharedSecretTokenProvider(username, secret);
MessagingFactory messagingFactory = MessagingFactory.Create(serviceUri, tokenProvider);
queueClient = messagingFactory.CreateQueueClient(queueName, ReceiveMode.ReceiveAndDelete);
RetryManager retryManager = EnterpriseLibraryContainer.Current.GetInstance<RetryManager>();
Microsoft.Practices.TransientFaultHandling.RetryPolicy serviceBusRetryPolicy = retryManager.GetDefaultAzureServiceBusRetryPolicy();
serviceBusRetryPolicy.ExecuteAction(() => {
using (BrokeredMessage message = queueClient.Receive(TimeSpan.FromHours(1))) {
if (message != null) {
//do stuff with the message
}
}
});
Is there something obvious that I'm missing, or does the service really encounter internal errors on a regular basis?