Search code examples
nservicebus

Cleint not receive response: “No handlers could be found for message type”


I have a .net core service that needs to send a request via nservicebus. I resolve IMessageSession with DI and send a request like this:

var response = await messageSession.Request<CreateDeviceResponse>(request);

In the logs I see that another service received this request and send a reply: enter image description here

The problem that I never receive a response. Client receive such errors: enter image description here

I know that such an issue can occur if the client and server endpoint names are same, but I checked and I use different names

asp net mvc 4.7.2


Solution

  • For some reason, it helped to make a request inside a task:

    Task.Run(async () => await messageSession.Request<CreateDeviceResponse>(request))
    

    I still not understand what is the problem, but it works only with such implementation. In .net core web API, it works even without Task.Run, so I believe it has something to do with the fact that I am making this request in asp net mvc 4.7.2