diff --git a/src/main/java/com/thinker/sql/SourceFromMySQL.java b/src/main/java/com/thinker/sql/SourceFromMySQL.java index 1544e57..ad208af 100644 --- a/src/main/java/com/thinker/sql/SourceFromMySQL.java +++ b/src/main/java/com/thinker/sql/SourceFromMySQL.java @@ -73,6 +73,7 @@ public class SourceFromMySQL extends RichSourceFunction { @Override public void cancel() { + } private static Connection getConnection() { diff --git a/src/main/java/com/thinker/util/KafkaUtils.java b/src/main/java/com/thinker/util/KafkaUtils.java index 5b87997..9e9f97d 100644 --- a/src/main/java/com/thinker/util/KafkaUtils.java +++ b/src/main/java/com/thinker/util/KafkaUtils.java @@ -34,7 +34,7 @@ public class KafkaUtils { Map fields = new HashMap<>(); tags.put("cluster", "zhisheng"); - tags.put("host_ip", "101.147.022.106"); + tags.put("host_ip", "127.0.0.1"); fields.put("used_percent", 90d); fields.put("max", 27244873d); @@ -53,8 +53,8 @@ public class KafkaUtils { public static void main(String[] args) throws InterruptedException { while (true) { - Thread.sleep(300); writeToKafka(); + Thread.sleep(3000); } }