Spring集成 - 如何使消息在jdbc消息存储区中存活,以防发生错误或在消费处理程序中关闭。

问题描述 投票:0回答:1

我有一个流程,将消息存储到jdbc消息存储中。

...
.channel { c -> c.queue(jdbcChannelMessageStore, "persist") }
.handle(MessageHandler { 
                        Thread.sleep(3000); 
                        throw RuntimeException() 
} ) { e -> e.poller { it.fixedDelay(1000)} }

如何确保消息不会被删除 直到hanler成功完成?

spring-integration spring-integration-dsl
1个回答
1
投票

让轮询器 .transactional() 这样下游的流程就会在事务中运行;直到流程结束(或移交给另一个线程),才会提交删除。

© www.soinside.com 2019 - 2024. All rights reserved.