fix(nui): delete JetStream consumer even when it’s push-based#94
Open
mimmeslemehrzad wants to merge 1 commit intonats-nui:mainfrom
Open
fix(nui): delete JetStream consumer even when it’s push-based#94mimmeslemehrzad wants to merge 1 commit intonats-nui:mainfrom
mimmeslemehrzad wants to merge 1 commit intonats-nui:mainfrom
Conversation
When deleting a consumer we previously fetched it via `stream.Consumer(...)` which only works for pull consumers. If the consumer was push-based, the code returned `ErrNotPullConsumer`. This change handles that by falling back to `stream.PushConsumer(...)` when `ErrNotPullConsumer` is encountered, then proceeds with deletion. Also improves error handling and keeps HTTP semantics unchanged (204 on success, 422 on client errors, 500 on server errors). Refs: NATS JetStream `ErrNotPullConsumer`
Author
|
any update? |
Collaborator
|
Hi and sorry for delay. is this issue occuring only on delete action for push consumers? |
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.
Summary
Deleting consumers failed for push-based consumers because we fetched them via
stream.Consumer(...)(pull-only). This change falls back tostream.PushConsumer(...)whenErrNotPullConsumeris returned, then proceedsto delete the consumer.
Motivation
Users can create JetStream consumers as either pull or push. Deletion should
work regardless of the delivery type.
Technical Notes
stream.Consumer(ctx, name); onErrNotPullConsumer, callstream.PushConsumer(ctx, name).204 on success).
Testing
DeliverSubject), then call DELETE: expect 204.Risks
Low; only affects delete path and narrows error cases.
Checklist