Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/clients/admin/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,9 @@ export class Admin extends Base<AdminOptions> {
}

#createTopics (options: CreateTopicsOptions, callback: CallbackWithPromise<CreatedTopic[]>): void {
const numPartitions = options.partitions ?? 1
const replicationFactor = options.replicas ?? 1
// -1 is required if manual assignments are used. If no manual assignments are used, -1 will default to broker settings.
const numPartitions = options.partitions ?? -1
const replicationFactor = options.replicas ?? -1
const assignments: CreateTopicsRequestTopicAssignment[] = []
const configs = options.configs ?? []

Expand Down
2 changes: 0 additions & 2 deletions test/clients/admin/admin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,6 @@ test('createTopics using assignments', async t => {
// Create a topic with a single partition - leader will be automatically assigned
const created = await admin.createTopics({
topics: [topicName],
partitions: -1,
replicas: -1,
assignments: brokerIds.map((brokerId, i) => ({ partition: i, brokers: [brokerId] }))
})

Expand Down
Loading