Skip to content

Commit c9fb0af

Browse files
committed
Make topic with compact.
(+semver: fix) Signed-off-by: Joshua Benjamin <joshuabnjmn@gmail.com>
1 parent 78aa01b commit c9fb0af

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/storage/kafka.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,13 @@ func newKafkaConsumer(broker string, replicas int16, storer SchemaStorer, topic
6565
}
6666
defer admin.Close()
6767

68+
compact := "compact"
6869
topicDetail := &sarama.TopicDetail{
6970
NumPartitions: 1,
7071
ReplicationFactor: replicas,
72+
ConfigEntries: map[string]*string{
73+
"cleanup.policy": &compact,
74+
},
7175
}
7276
err = admin.CreateTopic(topic, topicDetail, false)
7377
if err != nil && !strings.Contains(err.Error(), "already exists") {

0 commit comments

Comments
 (0)