logging - Spring Integration: How to know when a work flow completes? -
i working on adding logging/monitoring functionality multiple spring integration deployments. want create logger transaction @ start of workflow , close log transaction @ end of workflow. @ end of logger transaction send out logs , metrics centralized logging server. @ end of day want see logs messages went through workflows across multiple spring integration deployments.
the spring integration deployments across lot of teams , cant count on each team add logging code me, want write code run across spring integration deployments.
to start log transaction,the solution use global-channel interceptor on set of inbound messaging channels. workflows built across deployments use same set of inbound channels, start log transaction interceptor run. pass logger transaction details part of message headers
but having trouble figuring out solution ending transaction. workflows can synchronous asynchronous. not endpoints within workflow have output channel.
any strategies/ideas on how can close logger transaction ?
an example of sample workflow shown in image below:
when have flow ends channel adapter (or other endpoint produces no result), make last channel publish-subscribe-channel; subscribe second endpoint channel terminates "transaction".
i prefer add order
attribute on such endpoints - make regular endpoint order="1"
, flow terminator order="2"
- indicating called after main endpoint.
it important no task executor added channel endpoints called serially on same thread.
Comments
Post a Comment