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.
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.