Repository navigation
GH-3429: Expose non-destructive channel store message reads - #11597
2748109647 wants to merge 3 commits into
Conversation
…reads Fixes: spring-projects#3429 Channel stores cannot expose inspection through their shared API, and JDBC returns an empty message group even when messages are queued. * Promote collection and stream reads to BasicMessageGroupStore * Add JDBC queries with group/region isolation and the configured row mapper * Derive an unlimited inspection template without changing polling settings * Keep default JDBC groups lazy and preserve the existing factory overloads * Verify non-destructive reads, ordering, isolation and stream cleanup Signed-off-by: 樊孔缘 <[email protected]>
Signed-off-by: 樊孔缘 <[email protected]>
artembilan
left a comment
There was a problem hiding this comment.
This is great!
Please, mention this change in the x7.2-jdbc-changes section of the whats-new.adoc.
I am mostly worried about your name being ruined due to encoding changes between different operating systems or so.
Thank you!
| * | ||
| * @author Gary Russell | ||
| * @author Artem Bilan | ||
| * @author 樊孔缘 |
There was a problem hiding this comment.
Please, consider to use only Latin symbols for your name.
| /** | ||
| * Tests for non-destructive access through the basic store contract. | ||
| * | ||
| * @author 樊孔缘 |
There was a problem hiding this comment.
We also prefer @since for new test classes.
Not their methods, though 😄
| == Inspecting Stored Channel Messages | ||
|
|
||
| Starting with version 7.2, `getMessagesForGroup(groupId)` and `streamMessagesForGroup(groupId)` | ||
| are available through `BasicMessageGroupStore`, including `ChannelMessageStore`. |
There was a problem hiding this comment.
| * By default, obtains the messages from {@link #getMessageGroup(Object)}. | ||
| * @param groupId the group id to retrieve messages for. | ||
| * @return the messages for the group, empty if none exists. | ||
| * @since 7.2 |
There was a problem hiding this comment.
The whole new feature will go to the next 7.3 version.
Please, revise all the new @since in your change set.
Thank you!
Signed-off-by: 樊孔缘 <[email protected]>
|
Addressed in commit 8bca552.
Validation: git diff --check, core/JDBC main and test Checkstyle, and test compilation passed. I could not execute the tests locally: the Mockito/ByteBuddy javaagent fails to launch from the Windows path containing Chinese characters. I have not treated that as a passing test run. I did not add the earlier requested entry to x7.2-jdbc-changes because you clarified that the feature will be in 7.3; the current whats-new page has no 7.3 section yet. |
Fixes #3429.
Channel stores cannot currently expose non-destructive message reads through their shared API, and JDBC returns an empty message group even when the channel contains messages.
Promote
getMessagesForGroup()andstreamMessagesForGroup()toBasicMessageGroupStore, with defaults for existing implementations. Add JDBC inspection queries that reuse the configured query provider, row mapper, table prefix, group key, and region. Derive an unlimited inspection template without changing the polling template's row limit or other settings.JDBC's default factory returns lazy groups so inserts do not read the entire queue. Retain the existing
MessageGroupStorefactory overloads and add a basic-store overload. Inspection uses creation/sequence order, leaves FIFO and priority polling unchanged, and does not reserve messages against concurrent consumers. Document transaction visibility and stream ownership.Regression coverage includes non-destructive reads, lazy group creation, group/region isolation, priority polling after inspection, JSON row mapping with a custom table prefix, and connection release after partial stream consumption.
Validation on JDK 25 in Linux Docker: the complete
testtask passed across 44 modules (6,107 passed, 112 skipped, zero failures), together with core/JDBC main and test Checkstyle. Local verification init scripts supplied the pinned Linux protobuf binaries, the Mockito agent, and a scripting JVM option to avoid the image's incompatible libgraal; a TCP forwarder made Testcontainers' published ports reachable from the build container. These environment helpers are outside the PR.Redis follow-up
RedisChannelMessageStoreandRedisChannelPriorityMessageStorenow use persistent message groups, fetching contents only when read. The priority store aggregates priority keys in polling order.Focused validation on this updated branch passed:
./gradlew :spring-integration-redis:compileTestJavaand./gradlew :spring-integration-redis:test --tests org.springframework.integration.redis.store.RedisChannelMessageStoreTests.