-
Notifications
You must be signed in to change notification settings - Fork 162
6. OrderService Microservice Configure Kafka Topic
Ramesh Fadatare edited this page Jul 11, 2022
·
1 revision
package net.javaguides.orderservice.config;
import org.apache.kafka.clients.admin.NewTopic;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.kafka.config.TopicBuilder;
@Configuration
public class KafkaTopicConfig {
@Value("${spring.kafka.topic.name}")
private String topicName;
@Bean
public NewTopic javaguidesTopic(){
return TopicBuilder.name(topicName)
.build();
}
}