Created
January 18, 2022 16:59
-
-
Save engleangs/0c0208bcfdbd2e543e89049bd717f64e to your computer and use it in GitHub Desktop.
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 | |
public class KafkaTopicConfig { | |
private static final Logger LOGGER = LoggerFactory.getLogger( KafkaTopicConfig.class); | |
@Value(value = "${kafka.bootstrapAddress}") | |
private String bootstrapAddress; | |
@Bean | |
public KafkaAdmin kafkaAdmin() { | |
LOGGER.info("kafka admin address "+bootstrapAddress); | |
Map<String, Object> configs = new HashMap<>(); | |
configs.put(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapAddress); | |
return new KafkaAdmin(configs); | |
} | |
@Bean | |
public NewTopic topicSend() { | |
return new NewTopic("sms_api_send", 1, (short) 1); | |
} | |
@Bean | |
public NewTopic topicReceive() { | |
return new NewTopic("sms_receiving", 1, (short) 1); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment