NServiceBus can't find handlers on the host that is publishing the event.

901 views
Skip to first unread message

Chris

unread,
Jan 24, 2016, 5:21:46 PM1/24/16
to Particular Software
Helpful information to include
Product name: NServiceBus
Version: 5

Hi,

I have a problem with my current NServiceBus setup. I have a web application and an NServiceBus host instance with an EventStore (NEventStore). My web application is sending commands to the instance. The command gets handled and I publish an event in an aggregate which gets stored in the event store and is handled in the aggregate itself through a private method. The event that gets published is also handled in the web application to store in a local database. This all works fine, however, NServiceBus is complaining that there are no handlers for said event and is going to retry it three times on the NServiceBus Host. 

What could cause such behaviour? Is this a configuration issue? I assume that the host publishing the event doesn't necessarily need a public handle for it. The issue now disappears when I create such handler, but this is of course a messy solution because I don't need it there. The two endpoints have different names so they are not sharing the same queue. Please let me know if I can provide some of my code to clarify my issue a bit more.

Thank you!

Chris

simon.cropp

unread,
Jan 24, 2016, 6:50:23 PM1/24/16
to Particular Software
"NServiceBus is complaining that there are no handlers for said event and is going to retry it three times on the NServiceBus Host. "

Can you include the text of the log message that is "complaining"

Chris

unread,
Jan 27, 2016, 9:08:31 AM1/27/16
to Particular Software


Op maandag 25 januari 2016 00:50:23 UTC+1 schreef simon.cropp:
"NServiceBus is complaining that there are no handlers for said event and is going to retry it three times on the NServiceBus Host. "

Can you include the text of the log message that is "complaining"

Thank you Simon, the following is the error I am talking about:

2016-01-27 15:06:04.363 INFO  NServiceBus.Unicast.Transport.TransportReceiver Failed to process message
System.InvalidOperationException: No handlers could be found for message type: Domain.Statistics.Messages.Statistic.Events.Created
   at NServiceBus.LoadHandlersBehavior.Invoke(IncomingContext context, Action next) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Unicast\Behaviors\LoadHandlersBehavior.cs:line 29
   at NServiceBus.BehaviorChain`1.InvokeNext(T context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 107
   at NServiceBus.BehaviorChain`1.<>c__DisplayClass4_0.<InvokeNext>b__0() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 95
   at NServiceBus.Transports.RabbitMQ.ReadIncomingCallbackAddressBehavior.Invoke(IncomingContext context, Action next) in c:\BuildAgent\work\ef98ad7376e3379a\src\NServiceBus.RabbitMQ\ReadIncomingCallbackAddressBehavior.cs:line 17
   at NServiceBus.BehaviorChain`1.InvokeNext(T context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 107
   at NServiceBus.BehaviorChain`1.<>c__DisplayClass4_0.<InvokeNext>b__0() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 95
   at NServiceBus.BehaviorChain`1.InvokeNext(T context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 107
   at NServiceBus.BehaviorChain`1.<>c__DisplayClass4_0.<InvokeNext>b__0() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 95
   at NServiceBus.ExecuteLogicalMessagesBehavior.Invoke(IncomingContext context, Action next) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Unicast\Messages\ExecuteLogicalMessagesBehavior.cs:line 24
   at NServiceBus.BehaviorChain`1.InvokeNext(T context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 107
   at NServiceBus.BehaviorChain`1.<>c__DisplayClass4_0.<InvokeNext>b__0() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 95
   at NServiceBus.BehaviorChain`1.InvokeNext(T context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 107
   at NServiceBus.BehaviorChain`1.<>c__DisplayClass4_0.<InvokeNext>b__0() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 95
   at NServiceBus.BehaviorChain`1.InvokeNext(T context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 107
   at NServiceBus.BehaviorChain`1.<>c__DisplayClass4_0.<InvokeNext>b__0() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 95
   at NServiceBus.BehaviorChain`1.InvokeNext(T context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 107
   at NServiceBus.BehaviorChain`1.<>c__DisplayClass4_0.<InvokeNext>b__0() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 95
   at NServiceBus.BehaviorChain`1.InvokeNext(T context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 107
   at NServiceBus.BehaviorChain`1.<>c__DisplayClass4_0.<InvokeNext>b__0() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 95
   at NServiceBus.UnitOfWorkBehavior.Invoke(IncomingContext context, Action next) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\UnitOfWork\UnitOfWorkBehavior.cs:line 42
   at NServiceBus.BehaviorChain`1.InvokeNext(T context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 107
   at NServiceBus.BehaviorChain`1.<>c__DisplayClass4_0.<InvokeNext>b__0() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 95
   at NServiceBus.Transports.RabbitMQ.OpenPublishChannelBehavior.Invoke(IncomingContext context, Action next) in c:\BuildAgent\work\ef98ad7376e3379a\src\NServiceBus.RabbitMQ\OpenPublishChannelBehavior.cs:line 19
   at NServiceBus.BehaviorChain`1.InvokeNext(T context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 107
   at NServiceBus.BehaviorChain`1.<>c__DisplayClass4_0.<InvokeNext>b__0() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 95
   at NServiceBus.ChildContainerBehavior.Invoke(IncomingContext context, Action next) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Unicast\Behaviors\ChildContainerBehavior.cs:line 17
   at NServiceBus.BehaviorChain`1.InvokeNext(T context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 107
   at NServiceBus.BehaviorChain`1.<>c__DisplayClass4_0.<InvokeNext>b__0() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 95
   at NServiceBus.ProcessingStatisticsBehavior.Invoke(IncomingContext context, Action next) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Monitoring\ProcessingStatisticsBehavior.cs:line 23
   at NServiceBus.BehaviorChain`1.InvokeNext(T context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 107
   at NServiceBus.BehaviorChain`1.<>c__DisplayClass4_0.<InvokeNext>b__0() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 95
   at NServiceBus.AuditBehavior.Invoke(IncomingContext context, Action next) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Audit\AuditBehavior.cs:line 20
   at NServiceBus.BehaviorChain`1.InvokeNext(T context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 107
   at NServiceBus.BehaviorChain`1.Invoke() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 52
   at NServiceBus.Pipeline.PipelineExecutor.Execute[T](BehaviorChain`1 pipelineAction, T context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\PipelineExecutor.cs:line 129
   at NServiceBus.Unicast.Transport.TransportReceiver.OnTransportMessageReceived(TransportMessage msg) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Unicast\Transport\TransportReceiver.cs:line 413
   at NServiceBus.Unicast.Transport.TransportReceiver.ProcessMessage(TransportMessage message) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Unicast\Transport\TransportReceiver.cs:line 344
   at NServiceBus.Unicast.Transport.TransportReceiver.TryProcess(TransportMessage message) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Unicast\Transport\TransportReceiver.cs:line 230
   at NServiceBus.Transports.RabbitMQ.RabbitMqDequeueStrategy.ConsumeMessages(Object state) in c:\BuildAgent\work\ef98ad7376e3379a\src\NServiceBus.RabbitMQ\RabbitMqDequeueStrategy.cs:line 193

Indu Alagarsamy

unread,
Jan 27, 2016, 1:32:17 PM1/27/16
to Particular Software
Hi Chris,

From the exceptions it appears like your endpoint is missing the handler.

Your endpoint is receiving the following message: Domain.Statistics.Messages.Statistic.Events.Created
However, your endpoint does not seem to have a handler to handle that message. 

A handler is a class that implements : IHandleMessages<T>, where T is your message type.
For more details, please see:

Do you have a class that implements the message type that is being received by the endpoint?

Let us know if this helps,
Cheers,
Indu Alagarsamy

Chris

unread,
Jan 27, 2016, 2:58:51 PM1/27/16
to Particular Software
Hi Indu,

Thank you for your reply. I do understand what the message is saying and how to solve the problem. I am just not sure if the problem should occur in my situation. As you can read in my main question I am raising it in that specific endpoint, there is an aggregate (using NES) within that endpoint that is handling the event in a private method (this works), for some reason however I need to add a class with a public handle method within that endpoint for that error to go away. 

So my question is basically, is the endpoint that is raising the event required to have a public handle method handling that event? Can it never just raise it just to be handled on other endpoints?

Thanks

Op woensdag 27 januari 2016 19:32:17 UTC+1 schreef Indu Alagarsamy:

simon.cropp

unread,
Jan 27, 2016, 5:45:30 PM1/27/16
to Particular Software
Chris

What is the specific version of NServiceBus you are on?

Chris

unread,
Jan 28, 2016, 3:33:29 AM1/28/16
to Particular Software


Op woensdag 27 januari 2016 23:45:30 UTC+1 schreef simon.cropp:
Chris

What is the specific version of NServiceBus you are on?

Hi Simon, it's 5.2.12 

simon.cropp

unread,
Jan 28, 2016, 8:46:34 PM1/28/16
to Particular Software
Chris 

Are you certain you are publishing an event and not sending a message



you can see that the publisher has a handler for the message  https://github.com/SimonCropp/PubSubRepro/blob/master/MyPublisher/MyMessageHandler.cs
but when u comment that out you get the error described.

So based on the above can you share your code that does the publishing of the event

Reply all
Reply to author
Forward
0 new messages