Blizzard / Blizzard/node-rdkafka
Question: handling consumer stream errors gracefully (stream error, event.error)
- Dominant language
- JavaScript
- Stars
- 2.2k
- Forks
- 403
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
Research direction
Start with the consumer stream error handler and the event.error behavior described in the issue. Review the stream API and librdkafka error semantics, then document how fatal and recoverable errors should be handled and what recovery completion means; no specific files or tests are named.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, kafka, node.js
- Domain
- backend, stream-processing
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100