mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
Kafka增加参数acks和compressionType
This commit is contained in:
@@ -20,6 +20,8 @@ public class MQProperties {
|
||||
private int canalBatchSize = 50;
|
||||
private Long canalGetTimeout = 100L;
|
||||
private boolean flatMessage = true;
|
||||
private String compressionType = "none";
|
||||
private String acks = "all";
|
||||
|
||||
public static class CanalDestination {
|
||||
|
||||
@@ -149,4 +151,21 @@ public class MQProperties {
|
||||
public void setProducerGroup(String producerGroup) {
|
||||
this.producerGroup = producerGroup;
|
||||
}
|
||||
|
||||
public String getCompressionType() {
|
||||
return compressionType;
|
||||
}
|
||||
|
||||
public void setCompressionType(String compressionType) {
|
||||
this.compressionType = compressionType;
|
||||
}
|
||||
|
||||
public String getAcks() {
|
||||
return acks;
|
||||
}
|
||||
|
||||
public void setAcks(String acks) {
|
||||
this.acks = acks;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -37,7 +37,8 @@ public class CanalKafkaProducer implements CanalMQProducer {
|
||||
this.kafkaProperties = kafkaProperties;
|
||||
Properties properties = new Properties();
|
||||
properties.put("bootstrap.servers", kafkaProperties.getServers());
|
||||
properties.put("acks", "all");
|
||||
properties.put("acks", kafkaProperties.getAcks());
|
||||
properties.put("compression.type",kafkaProperties.getCompressionType());
|
||||
properties.put("retries", kafkaProperties.getRetries());
|
||||
properties.put("batch.size", kafkaProperties.getBatchSize());
|
||||
properties.put("linger.ms", kafkaProperties.getLingerMs());
|
||||
|
||||
Reference in New Issue
Block a user