Created
December 22, 2022 15:44
-
-
Save mehmetcemyucel/27e954f986da6505b60cd90478b2774c to your computer and use it in GitHub Desktop.
kafka-streams-config
This file contains 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 | |
@EnableKafka | |
@EnableKafkaStreams | |
public class KafkaConfig { | |
@Value(value = "${spring.kafka.bootstrap-servers}") | |
private String bootstrapAddress; | |
@Bean(name = KafkaStreamsDefaultConfiguration.DEFAULT_STREAMS_CONFIG_BEAN_NAME) | |
KafkaStreamsConfiguration kStreamsConfig() { | |
Map<String, Object> props = new HashMap<>(); | |
props.put(APPLICATION_ID_CONFIG, "cem-kafka-streams"); | |
props.put(BOOTSTRAP_SERVERS_CONFIG, bootstrapAddress); | |
props.put(DEFAULT_KEY_SERDE_CLASS_CONFIG, Serdes.String().getClass().getName()); | |
props.put(DEFAULT_VALUE_SERDE_CLASS_CONFIG, Serdes.String().getClass().getName()); | |
return new KafkaStreamsConfiguration(props); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment