Shuttle / shuttle-esb

Documentation for the Shuttle.Esb free open-source .NET/Core enterprise service bus.
http://shuttle.github.io/shuttle-esb/
127 stars 44 forks source link

MessageHandler does not get released if an exception it throws #36

Closed hopla closed 10 years ago

hopla commented 10 years ago

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); }

eben-roux commented 10 years ago

Hi hopla,

Thanks for picking that up.

Regards, Eben