修改kafka配置项属性
This commit is contained in:
@@ -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); // 获取指定数量的数据
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,6 @@ bufferMemory: 33554432
|
||||
topics:
|
||||
- topic: example
|
||||
partition:
|
||||
destination: example
|
||||
canalDestination: example
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user