简体   繁体   中英

Add message store spring integration dsl

I am currently looking at the options to add real-time tracking of all the messages going over in my application.

I have enabled messagehistory so technically I'll get all the steps happened during the flow.

Now I want to store each message with the history in disk cache using CQEngine as it has great support and is very quick.

Then from the UI I'll show the message and history and display using GraphVIZ so the users can actually see the lifecycle of each message with diagram.

Option # 01

Add the call in the handle() method in each flow to add the message and history asynchrnously in the disk cache.

But this means I'll have to manually do that every time for new flow.

Is there any option 02 I can utilize like adding interceptor etc that will be called whenever a flow is completed succesfully or un-sucessfully?

You need to use a WireTap interceptor for channels: https://docs.spring.io/spring-integration/docs/5.2.2.RELEASE/reference/html/core.html#channel-interceptors . And configure a global channel interceptor pattern for that wire-tap to specify those channels you would like to track. The same doc has info on the matter. Also see annotation configuration on the matter: https://docs.spring.io/spring-integration/docs/5.2.2.RELEASE/reference/html/configuration.html#annotations

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM