package cn.wise.sc.energy.power.plant.common.kafka.config;

import cn.wise.sc.energy.power.plant.common.kafka.service.IndicatorService;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

/**
 * @description: Kafka配置类
 * @author: qh
 * @create: 2020-05-18 13:46
 */
@Configuration
@ComponentScan(basePackages = "cn.wise.sc.energy.power.plant.common.kafka.service")
@EnableConfigurationProperties(KafkaTopicProperties.class)
public class KafkaTopicConfiguration {

  private final KafkaTopicProperties properties;

  public KafkaTopicConfiguration(KafkaTopicProperties properties) {
      this.properties = properties;
  }

  @Bean
  public String[] kafkaTopicName() {
    return properties.getTopicName();
  }

  @Bean
  public String topicGroupId() {
    return properties.getGroupId();
  }
}
