Helpful information to includeProduct name: NServiceBus
Version: NSB 5.0.0 with NServiceBus.Azure.Transports.WindowsAzureServiceBus 6.0.0 / NSB 5.0.1 with NServiceBus.Azure.Transports.WindowsAzureServiceBus 6.0.1
Stacktrace:
2014-10-11 15:51:00.224 INFO NServiceBus.Unicast.Transport.TransportReceiver Failed to process message
System.InvalidOperationException: This operation is only supported for a message receiver in 'PeekLock' receive mode.
at Microsoft.ServiceBus.Messaging.BrokeredMessage.ThrowIfNotLocked()
at Microsoft.ServiceBus.Messaging.BrokeredMessage.Complete()
at NServiceBus.Azure.Transports.WindowsAzureServiceBus.BrokeredMessageExtensions.SafeComplete(BrokeredMessage msg) in c:\BuildAgent\work\9e81da84cea5f13f\src\NServiceBus.Azure.Transports.WindowsAzureServiceBus\Utils\BrokeredMessageExtensions.cs:line 16
at NServiceBus.Azure.Transports.WindowsAzureServiceBus.AzureServiceBusDequeueStrategy.TryProcessMessage(Object obj) in c:\BuildAgent\work\9e81da84cea5f13f\src\NServiceBus.Azure.Transports.WindowsAzureServiceBus\Receiving\AzureServiceBusDequeueStrategy.cs:line 157
Description:
I have a simple Client and Server test application. The client sends a single command using Bus.Send. This is processed by a Saga on the server which, in return, publishes an event to be handled by the client.
The client send, server receive and server publish all work correctly.
However, when the client handler receives the message, the Handle method executes, but the above exception is logged after the handler has completed executing.
This is an extremely simple test app with minimal configuration. Both client and server endpoints are as follows have the following configurations:
public class EndpointConfig : IConfigureThisEndpoint, AsA_Server
{
public void Customize(BusConfiguration configuration)
{
configuration.Conventions().DefiningCommandsAs(t => t.Namespace != null && t.Namespace.EndsWith("Commands"));
configuration.Conventions().DefiningEventsAs(t => t.Namespace != null && t.Namespace.EndsWith("Events"));
configuration.UseTransport<AzureServiceBusTransport>();
configuration.UsePersistence<InMemoryPersistence>();
}
}
[the client specifies AsA_Client, not AsA_Server].
Both specify a working AzureServiceBusQueueConfig connection string in their app.config, plus the client also specifies the following endpoint mapping:
<MessageEndpointMappings>
<add Messages="NSBAzure.Messages" Type="NSBAzure.Messages.Events.NotifyUserReceived" Endpoint="nsbazure.server" />
</MessageEndpointMappings>
Have I missed some configuration or misunderstood how this should work, or is this a bug in the Azure Service Bus event handling?
Thanks,
Rob