viadeo / kasper-framework

Kasper is the treasure keeper
http://kasper-doc.viadeo.com/kasper-framework/latest/
GNU Lesser General Public License v3.0
9 stars 6 forks source link

[tags interceptor] Restore MDC context map after execution of next handler in chain #279

Closed omiel closed 9 years ago

omiel commented 9 years ago

ping @cmurer

Description of bug:

A Command/Query handler has a tag / several tags. The handler gets called inside another handler / inside an event listener. The tag(s) stay in the MDC context map after the call, so if an exception is raised by the calling handler / listener, the error will be searchable in Kibana under the callee handler tags.

This commit snapshots the MDC context map in the TagsInterceptor, before adding the targeted handler tags, and restore the MDC context map to its original state after the call to the next element in the chain completes.

cmurer commented 9 years ago

top