I have a flow that stores messages into jdbc message store:
...
.channel { c -> c.queue(jdbcChannelMessageStore, "persist") }
.handle(MessageHandler {
Thread.sleep(3000);
throw RuntimeException()
} ) { e -> e.poller { it.fixedDelay(1000)} }
How to make sure that message is not deleted until hanler succesfully finishes?
Make the poller .transactional()
so that the downstream flow runs in a transaction; the removal won't be committed until the flow ends (or hands off to another thread).