Repository navigation
fix: make ordered consumers recover and track runtime state - #60
Merged
Merged
Conversation
There was a problem hiding this comment.
Solid rewrite. The ordered consumer now actually tracks sequence state, detects ordering loss, and recreates with proper cursor carry-forward. Architecture is clean — own pull loop with message validation, recovery with bounded retries and exponential-ish backoff. Left a few inline notes, none blocking.
There was a problem hiding this comment.
Constructor validation for maxResetAttempts is the right call — fail-fast instead of surprising runtime semantics. Unit test coverage is clean. Explanation for the currentConsumerExists check makes sense (missing-responder fallback, not the normal timeout path). All feedback addressed. LGTM.
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.
Closes #37
Summary
OrderedConsumertrack stream and consumer sequence state in memory instead of acting as a thin config wrappermaxResetAttempts, exposeinactiveThresholdonOrderedConsumerConfig, and letpoll()/consumeLoop()run through the ordered wrapperVerification
vendor/bin/phpunit tests/Integration/JetStream/OrderedConsumerTest.php tests/Integration/JetStream/ConsumerTest.php tests/Integration/JetStream/ConsumeContextTest.php --testdoxvendor/bin/phpunit tests/Integration/KeyValue/KeyValueTest.php tests/Integration/KeyValue/KeyValueExtendedTest.php --testdoxvendor/bin/phpstan analyse --no-progress