I'm investigating the use of Spring Integration to implement the transactional outbox pattern.
I found a transactional outbox sample.
If my application needs multiple outboxes, I believe I need to use a unique groupId
when creating a queue that supports transactions using JdbcChannelMessageStore
.
However, it seems like entries in that queue will be processed one at a time. That of course makes sense to be able to guarantee order, at the cost of performance.
Is there a way to improve performance if I know that some entries may be processed in parallel? Specifically, imagine that events only need to be ordered for the same entity. In other words, I do not care about the order of events for different entities, but events for the same entity must remain ordered. That should make it possible to improve performance while still ensuring correctness.
I did take a look at the code in PostgresChannelMessageStoreQueryProvider#getPollFromGroupQuery and the schema for the INT_CHANNEL_MESSAGE table. It does not look like what I'm asking is currently possible?