-
Notifications
You must be signed in to change notification settings - Fork 1
fix: implement requester-side deduplication of reply messages by repl… #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements requester-side deduplication of reply messages to handle duplicate replies that may occur during operational scenarios such as broker updates or reconnections.
Changes:
- Added deduplication logic that tracks received
replyIndexvalues per request to ignore duplicate replies - Fixed timestamp initialization issues in test classes (milliseconds vs seconds)
- Added test coverage for the deduplication behavior
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/community/solace/spring/cloud/requestreply/service/ResponseHandler.java | Added per-request deduplication tracking using receivedIndices set and cleanup logic |
| src/main/java/community/solace/spring/cloud/requestreply/service/RequestReplyServiceImpl.java | Integrated deduplication check in onReplyReceived and fixed grouped message content-type handling |
| src/main/java/community/solace/spring/cloud/requestreply/service/header/RequestReplyMessageHeaderSupportService.java | Added getReplyIndex method to extract reply index from messages |
| src/main/java/community/solace/spring/cloud/requestreply/service/header/parser/SpringHeaderParser.java | Implemented MessageHeaderReplyIndexParser interface with getReplyIndex method |
| src/main/java/community/solace/spring/cloud/requestreply/service/header/parser/replyindex/MessageReplyIndexParser.java | New interface for parsing reply index from messages |
| src/main/java/community/solace/spring/cloud/requestreply/service/header/parser/replyindex/MessageHeaderReplyIndexParser.java | New interface extending MessageReplyIndexParser for header-based parsing |
| src/test/java/community/solace/spring/cloud/requestreply/service/TestSdtStreamSupport.java | New test helper for building SDTStream payloads |
| src/test/java/community/solace/spring/cloud/requestreply/service/RequestReplySimpleServiceTests.java | Added deduplication test and updated existing tests to use grouped messages |
| src/test/java/community/solace/spring/cloud/requestreply/model/SensorReading.java | Made fields mutable and added Jackson annotations for JSON deserialization |
| src/test/java/community/solace/spring/cloud/requestreply/AbstractRequestReplySimpleIT.java | Fixed timestamp values and changed method visibility |
| src/test/java/community/solace/spring/cloud/requestreply/AbstractRequestReplyMessageInterceptorIT.java | Fixed timestamp values and changed method visibility |
| src/test/java/community/solace/spring/cloud/requestreply/AbstractRequestReplyLoggingIT.java | Fixed timestamp values and changed method visibility |
| README.md | Added documentation explaining deduplication behavior and memory management |
| CHANGELOG.md | Added entry for version 5.3.5 documenting the fix |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/main/java/community/solace/spring/cloud/requestreply/service/ResponseHandler.java
Outdated
Show resolved
Hide resolved
3024c0c to
56da615
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5896e02 to
27cf4a9
Compare
…yIndex To prevent corrupt results when replies are duplicated (e.g. after broker disconnect/reconnect), the requester now deduplicates reply messages using the `replyIndex` header. Changes: - `ResponseHandler`: Implements deduplication logic using a `BitSet`. Supports both single and range indices. - `RequestReplyServiceImpl`: Integrates duplicate checking and fixes `CONTENT_TYPE` restoration for grouped SDTStream messages. - Configuration: Adds `spring.cloud.stream.requestreply.dedup.maxBitsWhenUnknown` (default 100,000) to limit memory usage when `totalReplies` is unknown. - Headers: Adds `MessageReplyIndexParser` infrastructure to extract `replyIndex`. - Tests: Fixes timestamp initialization to use milliseconds and adds deduplication scenarios. - Docs: Updates CHANGELOG and README for version 5.3.5.
27cf4a9 to
ffba321
Compare
[…yIndex](fix: implement requester-side deduplication of reply messages by replyIndex)