I have a problem with the Azure Service bus. Gradually placing a message on the bus raises the following exception:
TYPE: InvalidOperationException
MESSAGE: The operation could not be completed because the brokerage message "723eab13dab34351a78bb687d0923b89" has already been used. Use a new instance of BrokeredMessage to work.
Stacktrace
at Microsoft.ServiceBus.Messaging.MessagingUtilities.ValidateAndSetConsumedMessages(IEnumerable`1 messages) at Microsoft.ServiceBus.Messaging.MessageSender.Send(TrackingContext trackingContext, IEnumerable`1 messages, TimeSpan timeout) at Microsoft.Practices.TransientFaultHandling.RetryPolicy.<>c__DisplayClass1.<ExecuteAction>b__0() at Microsoft.Practices.TransientFaultHandling.RetryPolicy.ExecuteAction[TResult](Func`1 func) at IQ.IR.Core.ServiceBus.AzureBus`1.Enqueue(T message) in c:\BuildAgent\work\cc0c51104c02a4e9\IQ.IR.Core\ServiceBus\AzureBus.cs:line 69 ...Rest of stacktrace snipped as it within my app
AzureBus Protection Code:
public void Enqueue(T message) { using (var brokeredMessage = new BrokeredMessage(message) { Label = message.GetType().FullName, TimeToLive = _timeToLive }) { _retryPolicy.ExecuteAction(() => _sender.Send(brokeredMessage)); } }
Where message T is transmitted,
[Serializable] public class ValidationMessage { public string ValidationToken { get; set;} }
And _retryPolicy is
RetryPolicy<ServiceBusTransientErrorDetectionStrategy>
_timeToLive is a 12-hour time span
Any ideas?
source share