Blizzard / Blizzard/node-rdkafka

Consumer Stream Crashes if Topics Not Present

Open
#976 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.2k
Forks
403
PR merge metrics
No merged PRs in 30d

Description

**Environment Information**
- OS [e.g. Mac, Arch, Windows 10]: MAC
- Node Version [e.g. 8.2.1]: v16.13.2
- NPM Version [e.g. 5.4.2]: 8.19.2
- C++ Toolchain [e.g. Visual Studio, llvm, g++]:
- node-rdkafka version [e.g. 2.3.3]: 2.13.0

**Steps to Reproduce**

When creating the read stream, try passing in topic names that don't exist.

**node-rdkafka Configuration Settings**

```
const stream = Kafka.KafkaConsumer.createReadStream(consumerConfig, consumerTopicConfig, {
topics: ['topic-a-does-not-exist', 'topic-b-does exist']
});
```

**Additional context**

Error message thrown (and crash):

```
Error: Broker: Unknown topic or partition
at Function.createLibrdkafkaError [as create] (/Users/xxx/workspace/xxx/xxx/node_modules/node-rdkafka/lib/error.js:454:10)
at /Users/xxx/workspace/xxx/xxx/node_modules/node-rdkafka/lib/kafka-consumer.js:468:29
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.