fix: implement requester-side deduplication of reply messages by repl…#38
Merged
fix: implement requester-side deduplication of reply messages by repl…#38
Conversation
There was a problem hiding this comment.
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.
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.
GreenRover
approved these changes
Feb 6, 2026
SamuelGasser
approved these changes
Feb 6, 2026
nathanaelweber
approved these changes
Feb 6, 2026
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[…yIndex](fix: implement requester-side deduplication of reply messages by replyIndex)