No destination specified for message

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?

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

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

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

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”.

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?

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?

1 Like

Thanks Andreas. I did some custom assembly scanning across libraries and it got me through!

Glad to hear that, is there anything you think we can do to improve the situation?