简体   繁体   English

添加消息存储 spring 集成 dsl

[英]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.我已启用messagehistory,因此从技术上讲,我将了解流程中发生的所有步骤。

Now I want to store each message with the history in disk cache using CQEngine as it has great support and is very quick.现在我想使用CQEngine将每条带有历史记录的消息存储在磁盘缓存中,因为它有很好的支持并且非常快。

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.然后从 UI 中,我将使用GraphVIZ显示消息和历史记录并显示,以便用户可以通过图表实际查看每条消息的生命周期。

Option # 01选项#01

Add the call in the handle() method in each flow to add the message and history asynchrnously in the disk cache.在每个流中的 handle() 方法中添加调用,以在磁盘缓存中异步添加消息和历史记录。

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?是否有任何选项 02 我可以使用,例如添加拦截器等,每当流程成功或不成功时都会调用这些选项?

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 .您需要为频道使用WireTap拦截器: 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另请参阅有关此事的注释配置: https : //docs.spring.io/spring-integration/docs/5.2.2.RELEASE/reference/html/configuration.html#annotations

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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