Skip to content

Commit

Permalink
Respect default num partitions configuration when creating topics
Browse files Browse the repository at this point in the history
  • Loading branch information
Nevon committed Mar 8, 2022
1 parent 28fa55d commit 715afe9
Show file tree
Hide file tree
Showing 16 changed files with 45 additions and 13 deletions.
3 changes: 3 additions & 0 deletions docker-compose.0_10.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ services:
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka1:29092,PLAINTEXT_HOST://localhost:9092,SSL://kafka1:29093,SSL_HOST://localhost:9093,SASL_SSL://kafka1:29094,SASL_SSL_HOST://localhost:9094
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
KAFKA_DEFAULT_REPLICATION_FACTOR: '2'
KAFKA_NUM_PARTITIONS: '2'
KAFKA_DELETE_TOPIC_ENABLE: 'true'
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: '0'
KAFKA_SSL_KEYSTORE_FILENAME: 'kafka.server.keystore.jks'
Expand Down Expand Up @@ -84,6 +85,7 @@ services:
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka2:29095,PLAINTEXT_HOST://localhost:9095,SSL://kafka2:29096,SSL_HOST://localhost:9096,SASL_SSL://kafka2:29097,SASL_SSL_HOST://localhost:9097
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
KAFKA_DEFAULT_REPLICATION_FACTOR: '2'
KAFKA_NUM_PARTITIONS: '2'
KAFKA_DELETE_TOPIC_ENABLE: 'true'
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: '0'
KAFKA_SSL_KEYSTORE_FILENAME: 'kafka.server.keystore.jks'
Expand Down Expand Up @@ -132,6 +134,7 @@ services:
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka3:29098,PLAINTEXT_HOST://localhost:9098,SSL://kafka3:29099,SSL_HOST://localhost:9099,SASL_SSL://kafka3:29100,SASL_SSL_HOST://localhost:9100
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
KAFKA_DEFAULT_REPLICATION_FACTOR: '2'
KAFKA_NUM_PARTITIONS: '2'
KAFKA_DELETE_TOPIC_ENABLE: 'true'
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: '0'
KAFKA_SSL_KEYSTORE_FILENAME: 'kafka.server.keystore.jks'
Expand Down
3 changes: 3 additions & 0 deletions docker-compose.0_11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ services:
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka1:29092,PLAINTEXT_HOST://localhost:9092,SSL://kafka1:29093,SSL_HOST://localhost:9093,SASL_SSL://kafka1:29094,SASL_SSL_HOST://localhost:9094
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
KAFKA_DEFAULT_REPLICATION_FACTOR: '2'
KAFKA_NUM_PARTITIONS: '2'
KAFKA_DELETE_TOPIC_ENABLE: 'true'
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: '0'
KAFKA_SSL_KEYSTORE_FILENAME: 'kafka.server.keystore.jks'
Expand Down Expand Up @@ -84,6 +85,7 @@ services:
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka2:29095,PLAINTEXT_HOST://localhost:9095,SSL://kafka2:29096,SSL_HOST://localhost:9096,SASL_SSL://kafka2:29097,SASL_SSL_HOST://localhost:9097
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
KAFKA_DEFAULT_REPLICATION_FACTOR: '2'
KAFKA_NUM_PARTITIONS: '2'
KAFKA_DELETE_TOPIC_ENABLE: 'true'
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: '0'
KAFKA_SSL_KEYSTORE_FILENAME: 'kafka.server.keystore.jks'
Expand Down Expand Up @@ -132,6 +134,7 @@ services:
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka3:29098,PLAINTEXT_HOST://localhost:9098,SSL://kafka3:29099,SSL_HOST://localhost:9099,SASL_SSL://kafka3:29100,SASL_SSL_HOST://localhost:9100
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
KAFKA_DEFAULT_REPLICATION_FACTOR: '2'
KAFKA_NUM_PARTITIONS: '2'
KAFKA_DELETE_TOPIC_ENABLE: 'true'
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: '0'
KAFKA_SSL_KEYSTORE_FILENAME: 'kafka.server.keystore.jks'
Expand Down
3 changes: 3 additions & 0 deletions docker-compose.1_1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ services:
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka1:29092,PLAINTEXT_HOST://localhost:9092,SSL://kafka1:29093,SSL_HOST://localhost:9093,SASL_SSL://kafka1:29094,SASL_SSL_HOST://localhost:9094
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
KAFKA_DEFAULT_REPLICATION_FACTOR: '2'
KAFKA_NUM_PARTITIONS: '2'
KAFKA_DELETE_TOPIC_ENABLE: 'true'
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: '0'
KAFKA_SSL_KEYSTORE_FILENAME: 'kafka.server.keystore.jks'
Expand Down Expand Up @@ -84,6 +85,7 @@ services:
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka2:29095,PLAINTEXT_HOST://localhost:9095,SSL://kafka2:29096,SSL_HOST://localhost:9096,SASL_SSL://kafka2:29097,SASL_SSL_HOST://localhost:9097
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
KAFKA_DEFAULT_REPLICATION_FACTOR: '2'
KAFKA_NUM_PARTITIONS: '2'
KAFKA_DELETE_TOPIC_ENABLE: 'true'
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: '0'
KAFKA_SSL_KEYSTORE_FILENAME: 'kafka.server.keystore.jks'
Expand Down Expand Up @@ -132,6 +134,7 @@ services:
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka3:29098,PLAINTEXT_HOST://localhost:9098,SSL://kafka3:29099,SSL_HOST://localhost:9099,SASL_SSL://kafka3:29100,SASL_SSL_HOST://localhost:9100
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
KAFKA_DEFAULT_REPLICATION_FACTOR: '2'
KAFKA_NUM_PARTITIONS: '2'
KAFKA_DELETE_TOPIC_ENABLE: 'true'
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: '0'
KAFKA_SSL_KEYSTORE_FILENAME: 'kafka.server.keystore.jks'
Expand Down
3 changes: 3 additions & 0 deletions docker-compose.2_2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ services:
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka1:29092,PLAINTEXT_HOST://localhost:9092,SSL://kafka1:29093,SSL_HOST://localhost:9093,SASL_SSL://kafka1:29094,SASL_SSL_HOST://localhost:9094
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
KAFKA_DEFAULT_REPLICATION_FACTOR: '2'
KAFKA_NUM_PARTITIONS: '2'
KAFKA_DELETE_TOPIC_ENABLE: 'true'
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: '0'
KAFKA_SSL_KEYSTORE_FILENAME: 'kafka.server.keystore.jks'
Expand Down Expand Up @@ -83,6 +84,7 @@ services:
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka2:29095,PLAINTEXT_HOST://localhost:9095,SSL://kafka2:29096,SSL_HOST://localhost:9096,SASL_SSL://kafka2:29097,SASL_SSL_HOST://localhost:9097
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
KAFKA_DEFAULT_REPLICATION_FACTOR: '2'
KAFKA_NUM_PARTITIONS: '2'
KAFKA_DELETE_TOPIC_ENABLE: 'true'
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: '0'
KAFKA_SSL_KEYSTORE_FILENAME: 'kafka.server.keystore.jks'
Expand Down Expand Up @@ -130,6 +132,7 @@ services:
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka3:29098,PLAINTEXT_HOST://localhost:9098,SSL://kafka3:29099,SSL_HOST://localhost:9099,SASL_SSL://kafka3:29100,SASL_SSL_HOST://localhost:9100
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
KAFKA_DEFAULT_REPLICATION_FACTOR: '2'
KAFKA_NUM_PARTITIONS: '2'
KAFKA_DELETE_TOPIC_ENABLE: 'true'
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: '0'
KAFKA_SSL_KEYSTORE_FILENAME: 'kafka.server.keystore.jks'
Expand Down
3 changes: 3 additions & 0 deletions docker-compose.2_3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ services:
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka1:29092,PLAINTEXT_HOST://localhost:9092,SSL://kafka1:29093,SSL_HOST://localhost:9093,SASL_SSL://kafka1:29094,SASL_SSL_HOST://localhost:9094
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
KAFKA_DEFAULT_REPLICATION_FACTOR: '2'
KAFKA_NUM_PARTITIONS: '2'
KAFKA_DELETE_TOPIC_ENABLE: 'true'
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: '0'
KAFKA_SSL_KEYSTORE_FILENAME: 'kafka.server.keystore.jks'
Expand Down Expand Up @@ -83,6 +84,7 @@ services:
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka2:29095,PLAINTEXT_HOST://localhost:9095,SSL://kafka2:29096,SSL_HOST://localhost:9096,SASL_SSL://kafka2:29097,SASL_SSL_HOST://localhost:9097
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
KAFKA_DEFAULT_REPLICATION_FACTOR: '2'
KAFKA_NUM_PARTITIONS: '2'
KAFKA_DELETE_TOPIC_ENABLE: 'true'
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: '0'
KAFKA_SSL_KEYSTORE_FILENAME: 'kafka.server.keystore.jks'
Expand Down Expand Up @@ -130,6 +132,7 @@ services:
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka3:29098,PLAINTEXT_HOST://localhost:9098,SSL://kafka3:29099,SSL_HOST://localhost:9099,SASL_SSL://kafka3:29100,SASL_SSL_HOST://localhost:9100
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
KAFKA_DEFAULT_REPLICATION_FACTOR: '2'
KAFKA_NUM_PARTITIONS: '2'
KAFKA_DELETE_TOPIC_ENABLE: 'true'
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: '0'
KAFKA_SSL_KEYSTORE_FILENAME: 'kafka.server.keystore.jks'
Expand Down
3 changes: 3 additions & 0 deletions docker-compose.2_4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ services:
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka1:29092,PLAINTEXT_HOST://localhost:9092,SSL://kafka1:29093,SSL_HOST://localhost:9093,SASL_SSL://kafka1:29094,SASL_SSL_HOST://localhost:9094
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
KAFKA_DEFAULT_REPLICATION_FACTOR: '2'
KAFKA_NUM_PARTITIONS: '2'
KAFKA_DELETE_TOPIC_ENABLE: 'true'
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: '0'
KAFKA_SSL_KEYSTORE_FILENAME: 'kafka.server.keystore.jks'
Expand Down Expand Up @@ -83,6 +84,7 @@ services:
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka2:29095,PLAINTEXT_HOST://localhost:9095,SSL://kafka2:29096,SSL_HOST://localhost:9096,SASL_SSL://kafka2:29097,SASL_SSL_HOST://localhost:9097
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
KAFKA_DEFAULT_REPLICATION_FACTOR: '2'
KAFKA_NUM_PARTITIONS: '2'
KAFKA_DELETE_TOPIC_ENABLE: 'true'
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: '0'
KAFKA_SSL_KEYSTORE_FILENAME: 'kafka.server.keystore.jks'
Expand Down Expand Up @@ -130,6 +132,7 @@ services:
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka3:29098,PLAINTEXT_HOST://localhost:9098,SSL://kafka3:29099,SSL_HOST://localhost:9099,SASL_SSL://kafka3:29100,SASL_SSL_HOST://localhost:9100
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
KAFKA_DEFAULT_REPLICATION_FACTOR: '2'
KAFKA_NUM_PARTITIONS: '2'
KAFKA_DELETE_TOPIC_ENABLE: 'true'
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: '0'
KAFKA_SSL_KEYSTORE_FILENAME: 'kafka.server.keystore.jks'
Expand Down
3 changes: 3 additions & 0 deletions docker-compose.2_4_oauthbearer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ services:
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka1:29092,PLAINTEXT_HOST://localhost:9092,SSL://kafka1:29093,SSL_HOST://localhost:9093,SASL_SSL://kafka1:29094,SASL_SSL_HOST://localhost:9094
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
KAFKA_DEFAULT_REPLICATION_FACTOR: '2'
KAFKA_NUM_PARTITIONS: '2'
KAFKA_DELETE_TOPIC_ENABLE: 'true'
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: '0'
KAFKA_SSL_KEYSTORE_FILENAME: 'kafka.server.keystore.jks'
Expand Down Expand Up @@ -82,6 +83,7 @@ services:
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka2:29095,PLAINTEXT_HOST://localhost:9095,SSL://kafka2:29096,SSL_HOST://localhost:9096,SASL_SSL://kafka2:29097,SASL_SSL_HOST://localhost:9097
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
KAFKA_DEFAULT_REPLICATION_FACTOR: '2'
KAFKA_NUM_PARTITIONS: '2'
KAFKA_DELETE_TOPIC_ENABLE: 'true'
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: '0'
KAFKA_SSL_KEYSTORE_FILENAME: 'kafka.server.keystore.jks'
Expand Down Expand Up @@ -128,6 +130,7 @@ services:
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka3:29098,PLAINTEXT_HOST://localhost:9098,SSL://kafka3:29099,SSL_HOST://localhost:9099,SASL_SSL://kafka3:29100,SASL_SSL_HOST://localhost:9100
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
KAFKA_DEFAULT_REPLICATION_FACTOR: '2'
KAFKA_NUM_PARTITIONS: '2'
KAFKA_DELETE_TOPIC_ENABLE: 'true'
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: '0'
KAFKA_SSL_KEYSTORE_FILENAME: 'kafka.server.keystore.jks'
Expand Down
8 changes: 4 additions & 4 deletions src/admin/__tests__/createPartitions.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe('Admin', () => {

await expect(
admin.createPartitions({
topicPartitions: [{ topic: topicName + 'x', count: 2 }],
topicPartitions: [{ topic: topicName + 'x', count: 3 }],
})
).rejects.toHaveProperty('message', 'This server does not host this topic-partition')
})
Expand All @@ -75,7 +75,7 @@ describe('Admin', () => {

await expect(
admin.createPartitions({
topicPartitions: [{ topic: topicName, count: 2, assignments: [[10]] }],
topicPartitions: [{ topic: topicName, count: 3, assignments: [[10]] }],
})
).rejects.toHaveProperty('message', 'Replica assignment is invalid')
})
Expand Down Expand Up @@ -112,7 +112,7 @@ describe('Admin', () => {

await expect(
admin.createPartitions({
topicPartitions: [{ topic: topicName, count: 2 }],
topicPartitions: [{ topic: topicName, count: 3 }],
})
).resolves.not.toThrow()
})
Expand All @@ -132,7 +132,7 @@ describe('Admin', () => {
admin = createAdmin({ cluster, logger: newLogger() })
await expect(
admin.createPartitions({
topicPartitions: [{ topic: topicName, count: 2 }],
topicPartitions: [{ topic: topicName, count: 3 }],
})
).resolves.not.toThrow()

Expand Down
6 changes: 5 additions & 1 deletion src/admin/__tests__/fetchOffsets.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ describe('Admin', () => {
yetAnotherTopicName = `yet-another-topic-${secureRandom()}`
groupId = `consumer-group-id-${secureRandom()}`

await createTopic({ topic: topicName })
await Promise.all(
[topicName, anotherTopicName, yetAnotherTopicName].map(topic =>
createTopic({ topic, numPartitions: 1 })
)
)

logger = newLogger()
cluster = createCluster()
Expand Down
2 changes: 1 addition & 1 deletion src/admin/__tests__/getTopicMetadata.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ describe('Admin', () => {

expect(topicsMetadata[0]).toHaveProperty('name', existingTopicName)
expect(topicsMetadata[1]).toHaveProperty('name', newTopicName)
expect(topicsMetadata[1].partitions).toHaveLength(1)
expect(topicsMetadata[1].partitions).toHaveLength(2)
})

test('throws an error if the topic does not exist and "allowAutoTopicCreation" is false', async () => {
Expand Down
11 changes: 9 additions & 2 deletions src/broker/__tests__/createTopics.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ describe('Broker > createTopics', () => {
})
})

it('should use the default replication factor', async () => {
it('should use the default replication factor and num partitions if not specified', async () => {
await broker.connect()
const topicName = `test-topic-${secureRandom()}`
const response = await broker.createTopics({
Expand All @@ -110,7 +110,7 @@ describe('Broker > createTopics', () => {
{
type: ConfigResourceTypes.BROKER,
name: '0',
configNames: ['default.replication.factor'],
configNames: ['default.replication.factor', 'num.partitions'],
},
],
})
Expand All @@ -119,11 +119,18 @@ describe('Broker > createTopics', () => {
null,
10
)
const defaultNumPartitions = parseInt(
describeResponse.resources[0].configEntries[1].configValue,
null,
10
)
expect(defaultReplicationFactor).toBeGreaterThan(0)
expect(defaultNumPartitions).toBeGreaterThan(0)

const metadata = await broker.metadata([topicName])
expect(metadata.topicMetadata[0].partitionMetadata[0].replicas.length).toEqual(
defaultReplicationFactor
)
expect(metadata.topicMetadata[0].partitionMetadata).toHaveLength(defaultNumPartitions)
})
})
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"type":"Buffer","data":[0,0,0,2,0,31,116,101,115,116,45,116,111,112,105,99,45,99,56,100,56,99,97,51,100,57,53,52,57,53,99,54,98,57,48,48,100,0,0,0,1,255,255,0,0,0,0,0,0,0,0,0,31,116,101,115,116,45,116,111,112,105,99,45,48,53,48,102,98,50,101,54,97,101,100,49,51,97,57,53,52,50,56,56,0,0,0,1,255,255,0,0,0,0,0,0,0,0,0,0,19,136]}
{"type":"Buffer","data":[0,0,0,2,0,31,116,101,115,116,45,116,111,112,105,99,45,99,56,100,56,99,97,51,100,57,53,52,57,53,99,54,98,57,48,48,100,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,31,116,101,115,116,45,116,111,112,105,99,45,48,53,48,102,98,50,101,54,97,101,100,49,51,97,57,53,52,50,56,56,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,19,136]}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"type":"Buffer","data":[0,0,0,2,0,31,116,101,115,116,45,116,111,112,105,99,45,99,56,100,56,99,97,51,100,57,53,52,57,53,99,54,98,57,48,48,100,0,0,0,1,255,255,0,0,0,0,0,0,0,0,0,31,116,101,115,116,45,116,111,112,105,99,45,48,53,48,102,98,50,101,54,97,101,100,49,51,97,57,53,52,50,56,56,0,0,0,1,255,255,0,0,0,0,0,0,0,0,0,0,19,136,1]}
{"type":"Buffer","data":[0,0,0,2,0,31,116,101,115,116,45,116,111,112,105,99,45,99,56,100,56,99,97,51,100,57,53,52,57,53,99,54,98,57,48,48,100,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,31,116,101,115,116,45,116,111,112,105,99,45,48,53,48,102,98,50,101,54,97,101,100,49,51,97,57,53,52,50,56,56,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,19,136,1]}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"type":"Buffer","data":[0,0,0,2,0,74,116,101,115,116,45,116,111,112,105,99,45,102,100,101,54,55,98,53,97,55,57,55,57,56,52,97,99,48,56,51,55,45,53,53,52,57,50,45,49,98,102,50,102,51,48,97,45,99,99,101,56,45,52,48,51,100,45,56,56,57,55,45,54,57,48,50,97,48,98,56,54,102,98,48,0,0,0,1,255,255,0,0,0,0,0,0,0,0,0,74,116,101,115,116,45,116,111,112,105,99,45,51,100,54,99,53,51,97,102,50,101,48,102,57,98,49,100,49,55,53,55,45,53,53,52,57,50,45,99,98,100,101,50,51,52,52,45,100,57,100,51,45,52,97,100,55,45,98,52,48,56,45,57,57,54,99,100,97,49,51,101,54,101,53,0,0,0,1,255,255,0,0,0,0,0,0,0,0,0,0,19,136,0]}
{"type":"Buffer","data":[0,0,0,2,0,74,116,101,115,116,45,116,111,112,105,99,45,102,100,101,54,55,98,53,97,55,57,55,57,56,52,97,99,48,56,51,55,45,53,53,52,57,50,45,49,98,102,50,102,51,48,97,45,99,99,101,56,45,52,48,51,100,45,56,56,57,55,45,54,57,48,50,97,48,98,56,54,102,98,48,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,74,116,101,115,116,45,116,111,112,105,99,45,51,100,54,99,53,51,97,102,50,101,48,102,57,98,49,100,49,55,53,55,45,53,53,52,57,50,45,99,98,100,101,50,51,52,52,45,100,57,100,51,45,52,97,100,55,45,98,52,48,56,45,57,57,54,99,100,97,49,51,101,54,101,53,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,19,136,0]}
2 changes: 1 addition & 1 deletion src/protocol/requests/createTopics/v0/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = ({ topics, timeout = 5000 }) => ({

const encodeTopics = ({
topic,
numPartitions = 1,
numPartitions = -1,
replicationFactor = -1,
replicaAssignment = [],
configEntries = [],
Expand Down
2 changes: 1 addition & 1 deletion src/protocol/requests/createTopics/v1/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module.exports = ({ topics, validateOnly = false, timeout = 5000 }) => ({

const encodeTopics = ({
topic,
numPartitions = 1,
numPartitions = -1,
replicationFactor = -1,
replicaAssignment = [],
configEntries = [],
Expand Down

0 comments on commit 715afe9

Please sign in to comment.