-
Notifications
You must be signed in to change notification settings - Fork 53
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
[CHANGE] [JS] [CONSUMERS] fetch()/next() can fail on consumer/stream errors #667
Conversation
… to react to consumer deleted / not found server responses. Since these operations have a termination condition, such events are appropriate. Consume however will keep reporting if there's an error related to the stream or consumer. Clients that want to stop processing during a consume on consumer deleted/stream not found type errors should setup a listener and then call stop on the consumer if those conditions are reported. Order consumers work similarly in next() and fetch() as described above with the exception that consumer not found, really will attempt to recover (as ordered consumers recreate the consumer when there's an error). Applications that use next()/fetch() should trap errors, and re-attempt as desired.
…rce` to consume which will bail a consume if a resource such as a stream/consumer is not found or deleted. By default, `consume()` will attempt to recover.
…ordered consumer can overcome.
For the ordered consumer, when |
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.
LGTM
No, because consumer not found on ordered consumer will recreate.
|
This change modifies the behavior of
fetch()
andnext()
to react toconsumer deleted
/consumer not found
/stream not found
server responses. Since these operations have a termination condition (the end of thenext()
orfetch()
), such events are appropriate.Ordered consumers work similarly with
next()
andfetch()
as described above. Applications that use next()/fetch() should trap errors, and re-attempt as desired.consume()
API however will keep reporting via itsstatus()
if there's an error related to the stream or consumer. Clients that want to stop processing during a consume on consumer deleted/stream not found type errors should setup a listener and then callstop()
on the consumer if those conditions are reported and the desired behavior is to stop processing. If the problem resource becomes available,consume()
will resume. This is the existing behavior.This PR also adds the
abort_on_missing_resource
toconsume()
options. If a resource such as a stream is not found or consumer is deleted or not foundconsume()
will abort. Note that for ordered consumers will not honor the option if a consumer is not found, as order consumer recreates a consumer on the fly. However deleting an active ordered consumer or its stream will stop it if the option is provided.