jdbc backed channel on a cluster mode

128 Views Asked by At

I want to use the jdbc backed message channel. Reading the doc says that it is supported but after that I found a thread in the forum that explicitly says don't. Could you please clarify me if it's supported? In this case, could you guide me to do so? thanks in advance!

Docs: http://docs.spring.io/spring-integration/docs/4.2.0.BUILD-SNAPSHOT/reference/html/jdbc.html#jdbc-message-store-channels

Thread Forum: http://forum.spring.io/forum/spring-projects/integration/104995-spring-poller-against-jdbc-backed-queue-channel-clustered-mode

1

There are 1 best solutions below

0
On BEST ANSWER

Let me guess that you mean <queue> channel with MessageStore reference. With that we really can have cluster-wide channel, which allow to transport only one message per cluster. That means that only one consumer will be able to pull message from that persistence queue and there 3is guaranty do not lose messages during the system failure.

I think Spring Integration has an answer for you and it is exactly that JdbcChannelMessageStore.

The forum post which you faced is enough old. The world has been changed since there.

For example pay attention to the OracleChannelMessageStoreQueryProvider and its getPollFromGroupQuery() implementation. There is a query hint like:

FOR UPDATE SKIP LOCKED

which guaranties the single row per transaction. Other transactions skip the locked rows and lock their own. If transaction is successful the row for message is removed.

So, I hope that is what you asked.