0
votes

I have a problem where NServiceBus does not automatically create all queues.

If I run any of the endpoints (excluding the mvc web client) I get the following error. (The endpoints have been generated using ServiceMatrix)

2015-04-23 10:50:12.241 ERROR NServiceBus This endpoint is unable to contact the ServiceControl Backend to report endpoint information. You have the ServiceCont rol plugins installed in your endpoint. However, please ensure that the Particul ar ServiceControl service is installed on this machine, or if running ServiceCon trol on a different machine, then ensure that your endpoint's app.config / web.c onfig, AppSettings has the following key set appropriately: ServiceControl/Queue . For example: Additional details: {0} NServiceBus.Unicast.Queuing.QueueNotFoundException: Exchange for the recipient d oes not exist ---> RabbitMQ.Client.Exceptions.AlreadyClosedException: Already cl osed: The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=404, text="NOT_FOUND - no exchange 'particular.servicecontrol' in vhost '/' ", classId=60, methodId=40, cause= at RabbitMQ.Client.Impl.ModelBase.WaitForConfirms(TimeSpan timeout, Boolean& timedOut)...

So it seems like particular.servicecontrol is not being created. However the rest of the queues are indeed created.

If I run the web project I also get an exception: {"Cannot access a disposed object.\r\nObject name: 'CommonObjectBuilder'."}. This error happens on "Bus.Create(config)" and no queues are created.

if (Debugger.IsAttached)
{   

    config.UsePersistence<InMemoryPersistence>();

    config.EnableInstallers();
}

var bus = Bus.Create(config);

If I mannually add particular.servicecontrol to the queues all the errors disapear.

1
Could you please elaborate - you have installed ServiceControl and set it to use RabbitMQ but it did not create its own queue? Are you able to start ServiceControl at all?Alexey Zimarev

1 Answers

0
votes

So in the end basically my mistake was not updating my ServiceControl to use RabbitMQ.

NServiceBus do not fail nicely with the correct error messages when this happens. In effect the ServiceControl is responsible for creating the particular.servicecontrol queue and when this queue is missing all hell breaks loose in the Bus itself.

However it was not as simple as discussed in the Multi Transport installation documentation. In short, while NSB5 works with RabbitMQ v2.1.2 (latest stable), the ServiceControl binary requires v1.1.5. One therefore has to copy the binaries from "RabbitMQ.Client v3.2.1" and "RabbitMQ v2.1.2" nuget packages in "C:\Program Files (x86)\Particular Software\ServiceControl" else one gets

Configuration of transport Failed. Could not resolve type 'NServiceBus.RabbitMQ, NServiceBus.Transports.RabbitMQ' from Setting 'TransportType'. Ensure the assembly is present and that type is correctly defined in settings

when running the installation for RabbitMQ for the ServiceControl.

I found the solution here.