No destination specified for message

rabbitmq
nservicebus

(Brian Bak Laursen) #1

I yet again need some assistance.

We have our publishing / subscribe queues working as a charm between our Microservices.

We have not arrived at the place where we wish to send Commands across the same queues.

We’ve added the “RouteToEndpoint” to our Routing configuration as seen here:

       var transport = endpointConfiguration.UseTransport<RabbitMQTransport>();
       var routing = transport.Routing();
       routing.RouteToEndpoint(
           assembly: typeof(AssetMetadataUpdate).Assembly, 
           destination: EndpointNameHelper.CoreSubscriberQueueName(dbRef));

       transport.ConnectionString(connectionString);
       transport.UseConventionalRoutingTopology();
       transport.UseDurableExchangesAndQueues(true);
        
        var startedEndpoint = Endpoint.Start(endpointConfiguration).GetAwaiter().GetResult();
        EndpointSubscriptionsAndRoutes(startedEndpoint);

        services.AddSingleton<IMessageSession>(startedEndpoint);

We keep getting the exception that no destination is found: No destination specified for message:Messaging.Shared.Commands.Asset.AssetMetadataUpdate

Any good suggestions on overcoming this?


(Andreas Öhlund) #2

Could is be that the message isn’t flagged as a IMessage or ICommand ?

https://docs.particular.net/nservicebus/messaging/messages-events-commands#defining-messages

Does it work if you configure the route explicitly for the type?

routing.RouteToEndpoint(
    messageType: typeof(AssetMetadataUpdate),
    destination: "blah");

(Brian Bak Laursen) #3

We are using conventions and have a ICommand interface of our own.

var conventions = endpointConfiguration.Conventions();
conventions.DefiningCommandsAs(t => t.Namespace != null && t.Namespace.StartsWith(“Messaging.Shared.Commands”));
conventions.DefiningEventsAs(t => t.Namespace != null && t.Namespace.StartsWith(“Messaging.Shared.Events”));
conventions.DefiningMessagesAs(t => t.Namespace != null && t.Namespace.StartsWith(“Messaging.Shared.Messages”));

And I can also see that I cannot even instantiate the RouteToEndpoint method call if it is not of the convention “Command”.


(Brian Bak Laursen) #4

I think I have found the issue.

It is nothing to do with the above.

It seems like my application which is running in the IIS (locally) is not picking up all handlers. The strange thing here is that the subscribe queue is correctly coming up as a Connection in the rabbtmq management UI.

This means that the endpoint is correctly created but it does not create any exchanges or find handlers.

I guess it is an IIS problem. Any suggestions?


(Andreas Öhlund) #5

Sounds to me that you have assembly scanning issues.

Are all the expected assemblies present in the bin folder?

Do the missing handlers in assemblies with dependencies that might be missing?

Anything in the logs that suggests that assemblies where skipped during scanning?

https://docs.particular.net/nservicebus/hosting/assembly-scanning