RabbitMQ - queue not created

I’m brand new to NServiceBus, so forgive me if my question is not 100% clear.

I’m migrating an existing project using NServiceBus version 6.4.3 from MSMQ transport to RabbotMQ transport version 4.4.5.

To get things started I’m using a free version of AMQP Cloud.

So I followed the docs to set up RabbitMQ as follows:

var transport = endpointConfiguration.UseTransport<RabbitMQTransport>();    
transport.ConnectionString("host=...;username=...;password=...;virtualhost=...");
transport.DelayedDelivery().DisableTimeoutManager();

I’m running my project and sending a command, the command goes through, and when finishes it publishes a message.
The message doesn’t go through.
I installed ServiceControl and ServiceInsight to try and have a look at the messages.
I’ve added a new ServiceControl instance using the same connection string and it created a service URL (http://localhost:33333/api/), I’ve added it to ServiceInsight but I still can’t see anything there.

Here is the exception I’m getting:

{
	"appname": "NServiceBus.Host",
	"logger": "ServiceControl.Features.Heartbeats",
	"fields.version": "Could not find value for entry assembly and version type Assembly",
	"exception": "NServiceBus.Unicast.Queuing.QueueNotFoundException: Failed to send message to address: [particular.servicecontrol] ---> System.Messaging.MessageQueueException: The queue does not exist or you do not have sufficient permissions to perform the operation.\r\n   at System.Messaging.MessageQueue.MQCacheableInfo.get_WriteHandle()\r\n   at System.Messaging.MessageQueue.StaleSafeSendMessage(MQPROPS properties, IntPtr transaction)\r\n   at System.Messaging.MessageQueue.SendInternal(Object obj, MessageQueueTransaction internalTransaction, MessageQueueTransactionType transactionType)\r\n   at System.Messaging.MessageQueue.Send(Object obj, String label, MessageQueueTransactionType transactionType)\r\n   at NServiceBus.MsmqMessageDispatcher.ExecuteTransportOperation(TransportTransaction transaction, UnicastTransportOperation transportOperation) in C:\\BuildAgent\\work\\a93f853f0c1b9532\\src\\NServiceBus.Core\\Transports\\Msmq\\MsmqMessageDispatcher.cs:line 89\r\n   --- End of inner exception stack trace ---\r\n   at NServiceBus.MsmqMessageDispatcher.ExecuteTransportOperation(TransportTransaction transaction, UnicastTransportOperation transportOperation) in C:\\BuildAgent\\work\\a93f853f0c1b9532\\src\\NServiceBus.Core\\Transports\\Msmq\\MsmqMessageDispatcher.cs:line 108\r\n   at NServiceBus.MsmqMessageDispatcher.Dispatch(TransportOperations outgoingMessages, TransportTransaction transaction, ContextBag context) in C:\\BuildAgent\\work\\a93f853f0c1b9532\\src\\NServiceBus.Core\\Transports\\Msmq\\MsmqMessageDispatcher.cs:line 36\r\n   at ServiceControl.Plugin.ServiceControlBackend.Send(Byte[] body, String messageType, TimeSpan timeToBeReceived) in C:\\BuildAgent\\work\\a58b2f713ea0114f\\src\\ServiceControl.Plugin.Nsb6.Heartbeat\\ServiceControlBackend.cs:line 56\r\n   at ServiceControl.Plugin.ServiceControlBackend.Send(EndpointHeartbeat messageToSend, TimeSpan timeToBeReceived) in C:\\BuildAgent\\work\\a58b2f713ea0114f\\src\\ServiceControl.Plugin.Nsb6.Heartbeat\\ServiceControlBackend.cs:line 92\r\n   at ServiceControl.Features.Heartbeats.HeartbeatStartup.<SendHeartbeatMessage>d__7.MoveNext() in C:\\BuildAgent\\work\\a58b2f713ea0114f\\src\\ServiceControl.Plugin.Nsb6.Heartbeat\\Heartbeats.cs:line 148",
	"message": "Unable to send heartbeat to ServiceControl."
}

I’ve noticed that it says that a queue named “particular.servicecontrol” does not exist, so I’ve added it to my RabbitMQ instance manually (Just click on “Add queue” and entered the queue name).

Any ideas on:

  1. Why my published events are not queued/handled?
  2. Why am I not seeing anything in ServiceInsight?

Thanks!

Hi @frliran

Trying answer for your questions:

  • Check if you have any message handler for published message. If yes check if the Endpoint who owns the message handler has also configured RabbitMQ transport.
  • Based on the part of the exception info:
C:\\BuildAgent\\work\\a93f853f0c1b9532\\src\\NServiceBus.Core\\Transports\\Msmq\\MsmqMessageDispatcher.cs:line 89
  • I guess that somewhere there is still MSMQ configuration so NServiceBus try to send Heartbeats through MSMQ transport and not through RabbitMQ transport.
  • You shouldn’t create “particular.servicecontrol” yourself. If you don’t see this queue in your RabbitMQ environment make sure that you select RabbitMQ transport during configuration ServiceControl instance in ServiceControl Management Utility.

I assume from this topic that the sample code works properly in your Rabbit environment. You can try configure ServiceControl and ServiceInsight to see messages from the sample code. After that you will be sure that potential errors/exceptions/not working issues/… will be associated with the code migration changes.

Hope this help.