DefaultMessageDispatcher.Dispatch should throw an exception when no handler is found


The current implementation simply ignores the fact that there this no handler to process the submitted message.
For me this is wrong as my ActiveMQ transport uses transactions to grab messages and relies on exceptions to rollback the transaction.
If nothing happens, then the message is swallowed.
With an exception, the endpoint would retry it several times, then ActiveMQ would move it to the Dead Letter Queue automatically. In that case, I can watch the DLQ and take action...
Closed Jul 8, 2010 at 10:48 AM by HakanL


PlasticLIzard wrote Sep 17, 2009 at 6:24 PM

Makes sense. Probably the right thing to do is add a configuration option, UnhandledMessageBehavior, which could be used to specify the bus should throw an exception if it doesn't come up with a handler.

wrote Oct 9, 2009 at 12:16 AM

wrote Jul 8, 2010 at 3:34 AM

HakanL wrote Jul 8, 2010 at 6:00 AM

After further discussion we believe it will be enough to always throw an exception, even if this is a breaking change (where in the current version it just silently ignored the unhandled message, a behavior we don't think is very useful, and if needed one can just implement a dummy handler).

wrote Jul 8, 2010 at 6:01 AM

wrote Jul 8, 2010 at 6:06 AM

HakanL wrote Jul 8, 2010 at 10:36 AM

The change that was made that throws an exception if no handler is registered causes an issue with Request/Response patterns. When a Response object (correlated) is received back by the caller it will throw this exception that no handler is registered. This is related to [workitem:4934]

HakanL wrote Jul 8, 2010 at 10:47 AM

Tested in trunk, I get an exception on unhandled messages

wrote Jul 8, 2010 at 10:48 AM

wrote Feb 14, 2013 at 3:23 AM

wrote May 16, 2013 at 7:46 AM