Browse Source

优化调整

jkzlzhoujie 6 years ago
parent
commit
99de55b9cf
1 changed files with 0 additions and 17 deletions
  1. 0 17
      src/main/java/com/yihu/ehr/kafka/Producer.java

+ 0 - 17
src/main/java/com/yihu/ehr/kafka/Producer.java

@ -27,23 +27,6 @@ public class Producer {
    Logger logger = LoggerFactory.getLogger(Producer.class);
    private static String topic = "sep-hbase-data";
    public static void main(String[] args) {
        try {
            Yaml yaml = new Yaml();
            URL url = Producer.class.getClassLoader().getResource("application.yml");
            if (url != null) {
                Map map =(Map)yaml.load(new FileInputStream(url.getFile()));
                Map map2 = (Map)map.get("kafka");
                Map map3 = (Map)map2.get("broker");
                System.out.println(map3.get("address"));
                //通过map我们取值就可以了.
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    public ProducerFactory<String, String> producerFactory() {
        String kafkaBrokerAddress = "";
        try {