Makky
Makky

Reputation: 17471

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?

Upvotes: 0

Views: 373

Answers (1)

Artem Bilan
Artem Bilan

Reputation: 121552

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

Upvotes: 2

Related Questions