Spring集成是实现交易量输出模式的好框架吗?

发布于 2025-01-29 09:01:30 字数 1394 浏览 2 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一身骄傲 2025-02-05 09:01:30

这正是春季整合的目的。

您可能会考虑使用基于其中的JDBCCHANNELMESSAGESTOREQueuechannel。因此,一项服务将在其交易中将消息发送到此渠道。另一方面,将会有一个投票消费者可以从该渠道阅读,因此您的消息表。注意:此解决方案在轮询事务结束时从int_channel_message表中删除消息。

您可能会考虑使用JPA出站通道适配器在一侧持续存在消息,而另一侧的JPA轮询通道adpater来更新实体。

请参阅文档中的更多信息: https:// docs:// 。

That's exactly what Spring Integration is for.

You probably may consider to use a JdbcChannelMessageStore and a QueueChannel based in it. So, one service would send a message to this channel within its transaction. On the other side there is going to be a polling consumer to read from that channel, and therefore your messages table. NOTE: this solution removes messages from the INT_CHANNEL_MESSAGE table in the end of poll transaction.

You may consider to use a JPA Outbound Channel Adapter to persist message on one side and JPA Polling Channel Adpater on the other side to update the entity.

See more in docs: https://docs.spring.io/spring-integration/docs/current/reference/html/jpa.html#jpa

Either way I don't see problems in implementing that pattern with Spring Integration.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文