When an exception is thrown by an exception-handler, the handler is never passed to MessageHandlerFactory.ReleaseHandler().
This causes the Dispose() method of the handler never to be called.
I suggest the calling of the message handler in to be changed to:
When an exception is thrown by an exception-handler, the handler is never passed to MessageHandlerFactory.ReleaseHandler(). This causes the Dispose() method of the handler never to be called.
I suggest the calling of the message handler in to be changed to:
try { InvokeHandler(bus, handler, transportMessage, message, pipelineEvent, message.GetType()); } finally { bus.Configuration.MessageHandlerFactory.ReleaseHandler(handler); }