Browse Source

修改kafka配置项属性

rewerma 7 years ago
parent
commit
330da50a5e

+ 3 - 3
kafka/src/main/java/com/alibaba/otter/canal/kafka/producer/CanalKafkaStarter.java

@@ -91,9 +91,9 @@ public class CanalKafkaStarter {
     private static void worker(Topic topic) {
         while (!running) ;
         while (!CanalServerStarter.isRunning()) ; //等待server启动完成
-        logger.info("## start the canal consumer: {}.", topic.getDestination());
+        logger.info("## start the canal consumer: {}.", topic.getCanalDestination());
         CanalServerWithEmbedded server = CanalServerWithEmbedded.instance();
-        ClientIdentity clientIdentity = new ClientIdentity(topic.getDestination(), (short) 1001, "");
+        ClientIdentity clientIdentity = new ClientIdentity(topic.getCanalDestination(), (short) 1001, "");
         while (running) {
             try {
                 if (!server.getCanalInstances().containsKey(clientIdentity.getDestination())) {
@@ -105,7 +105,7 @@ public class CanalKafkaStarter {
                     continue;
                 }
                 server.subscribe(clientIdentity);
-                logger.info("## the canal consumer {} is running now ......", topic.getDestination());
+                logger.info("## the canal consumer {} is running now ......", topic.getCanalDestination());
 
                 while (running) {
                     Message message = server.getWithoutAck(clientIdentity, 5 * 1024); // 获取指定数量的数据

+ 5 - 5
kafka/src/main/java/com/alibaba/otter/canal/kafka/producer/KafkaProperties.java

@@ -21,7 +21,7 @@ public class KafkaProperties {
     public static class Topic {
         private String topic;
         private Integer partition;
-        private String destination;
+        private String canalDestination;
 
         public String getTopic() {
             return topic;
@@ -39,12 +39,12 @@ public class KafkaProperties {
             this.partition = partition;
         }
 
-        public String getDestination() {
-            return destination;
+        public String getCanalDestination() {
+            return canalDestination;
         }
 
-        public void setDestination(String destination) {
-            this.destination = destination;
+        public void setCanalDestination(String canalDestination) {
+            this.canalDestination = canalDestination;
         }
     }
 

+ 1 - 1
kafka/src/main/resources/kafka.yml

@@ -7,6 +7,6 @@ bufferMemory: 33554432
 topics:
   - topic: example
     partition:
-    destination: example
+    canalDestination: example