Skip to content
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

Question: handling consumer stream errors gracefully (stream error, event.error) #1076

Open
MDSLKTR opened this issue Apr 23, 2024 · 0 comments

Comments

@MDSLKTR
Copy link

MDSLKTR commented Apr 23, 2024

Assuming you are using the stream api for consumers a regular error event handler might look like this

this.consumerStream.on('error', error => {
                logger.error(
                    `[${this.name}]: Kafka consumer for topic: ${this.consumerOptions.topicName} caused stream error: ${error.message}`,
                    error,
                );
            });

What would be the proper comeback strategy from this? Do you need to check whether the error is fatal or not in (event.error)?. I am wondering how to handle these properly. In case the listener is not there a service would just crash with an uncaughtException.
Any advise is much appreciated.

@MDSLKTR MDSLKTR changed the title Question: handling consumer stream errors Question: handling consumer stream errors gracefully (stream error, event.error) Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant