Last active
July 24, 2018 20:22
-
-
Save schroedermatt/7a60d8cd1e29c6282e97536278d8c1b2 to your computer and use it in GitHub Desktop.
Spring Kafka Config blog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kafka: | |
topics: | |
- | |
name: testing-auto-setup | |
num-partitions: 5 | |
replication-factor: 1 | |
- | |
name: another-test | |
num-partitions: 3 | |
replication-factor: 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Configuration | |
@ConfigurationProperties(prefix = "kafka") | |
class TopicConfigurations { | |
List<TopicConfiguration> topics; | |
static class TopicConfiguration { | |
String name; | |
Integer numPartitions = 3; | |
Short replicationFactor = 1; | |
NewTopic toNewTopic() { | |
return new NewTopic(this.name, this.numPartitions, this.replicationFactor); | |
} | |
} | |
}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment