Skip to content

Commit

Permalink
Merge pull request #1360 from tulios/document-breaking-create-topics-…
Browse files Browse the repository at this point in the history
…change

Document breaking change for admin.createTopics
  • Loading branch information
Nevon authored May 16, 2022
2 parents 597da90 + d293c44 commit 34fac96
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ This is the first major version released in 4 years, and contains a few importan
- **BREAKING:** Change default partitioner to Java compatible #1339
- Improve consumer performance #1258
- **BREAKING:** Enforce request timeout by default #1337
- Honor default replication factor and partition count when creating topics #1305
- **BREAKING** Honor default replication factor and partition count when creating topics #1305
- Increase default authentication timeout to 10 seconds #1340

### Fixed
Expand Down
12 changes: 12 additions & 0 deletions docs/MigrationGuide-2-0-0.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,18 @@ for (const topic of topics) {
}
```

## Admin: `createTopics` respects cluster settings `num.partitions` and `default.replication.factor`

Previously, `admin.createTopics` would default to creating topics with 1 partition and a replication factor of 1. It will now instead respect the cluster settings for partition count and replication factor. If the cluster does not have a default partition count or replication factor, topic creation will fail with an error.

To continue to create topics with 1 partition and a replication factor of 1, either configure the cluster with those defaults or provide them when creating the topic:

```js
await admin.createTopics({
topics: [{ topic: 'topic-name', numPartitions: 1, replicationFactor: 1 }]
})
```

## Removed support for Node 10 and 12

KafkaJS supports all currently supported versions of NodeJS. If you are currently using NodeJS 10 or 12, you will get a warning when installing KafkaJS, and there is no guarantee that it will function. We **strongly** encourage you to upgrade to a supported, secure version of NodeJS.
Expand Down
15 changes: 13 additions & 2 deletions website/versioned_docs/version-2.0.0/MigrationGuide-2-0-0.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
id: version-2.0.0-migration-guide-v2.0.0
id: migration-guide-v2.0.0
title: Migrating to v2.0.0
original_id: migration-guide-v2.0.0
---

v2.0.0 is the first major version of KafkaJS released since 2018. For most users, the required changes in order to upgrade from 1.x.x are very minor, but it is still important to read through the list of changes to know what, if any, changes need to be made.
Expand Down Expand Up @@ -146,6 +145,18 @@ for (const topic of topics) {
}
```

## Admin: `createTopics` respects cluster settings `num.partitions` and `default.replication.factor`

Previously, `admin.createTopics` would default to creating topics with 1 partition and a replication factor of 1. It will now instead respect the cluster settings for partition count and replication factor. If the cluster does not have a default partition count or replication factor, topic creation will fail with an error.

To continue to create topics with 1 partition and a replication factor of 1, either configure the cluster with those defaults or provide them when creating the topic:

```js
await admin.createTopics({
topics: [{ topic: 'topic-name', numPartitions: 1, replicationFactor: 1 }]
})
```

## Removed support for Node 10 and 12

KafkaJS supports all currently supported versions of NodeJS. If you are currently using NodeJS 10 or 12, you will get a warning when installing KafkaJS, and there is no guarantee that it will function. We **strongly** encourage you to upgrade to a supported, secure version of NodeJS.
Expand Down

0 comments on commit 34fac96

Please sign in to comment.