|
@@ -180,8 +180,8 @@ public class SimpleCanalConnector implements CanalConnector {
|
|
|
|
|
|
Ack ackBody = Ack.parseFrom(ack.getBody());
|
|
Ack ackBody = Ack.parseFrom(ack.getBody());
|
|
if (ackBody.getErrorCode() > 0) {
|
|
if (ackBody.getErrorCode() > 0) {
|
|
- throw new CanalClientException("something goes wrong when doing authentication: "
|
|
|
|
- + ackBody.getErrorMessage());
|
|
|
|
|
|
+ throw new CanalClientException(
|
|
|
|
+ "something goes wrong when doing authentication: " + ackBody.getErrorMessage());
|
|
}
|
|
}
|
|
|
|
|
|
connected = true;
|
|
connected = true;
|
|
@@ -323,7 +323,9 @@ public class SimpleCanalConnector implements CanalConnector {
|
|
Packet p = Packet.parseFrom(data);
|
|
Packet p = Packet.parseFrom(data);
|
|
switch (p.getType()) {
|
|
switch (p.getType()) {
|
|
case MESSAGES: {
|
|
case MESSAGES: {
|
|
- if (!p.getCompression().equals(Compression.NONE)) {
|
|
|
|
|
|
+ // if (!p.getCompression().equals(Compression.NONE)) {
|
|
|
|
+ if (!p.getCompression().equals(Compression.NONE)
|
|
|
|
+ && !p.getCompression().equals(Compression.COMPRESSIONCOMPATIBLEPROTO2)) {
|
|
throw new CanalClientException("compression is not supported in this connector");
|
|
throw new CanalClientException("compression is not supported in this connector");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -360,11 +362,8 @@ public class SimpleCanalConnector implements CanalConnector {
|
|
.setBatchId(batchId)
|
|
.setBatchId(batchId)
|
|
.build();
|
|
.build();
|
|
try {
|
|
try {
|
|
- writeWithHeader(Packet.newBuilder()
|
|
|
|
- .setType(PacketType.CLIENTACK)
|
|
|
|
- .setBody(ca.toByteString())
|
|
|
|
- .build()
|
|
|
|
- .toByteArray());
|
|
|
|
|
|
+ writeWithHeader(
|
|
|
|
+ Packet.newBuilder().setType(PacketType.CLIENTACK).setBody(ca.toByteString()).build().toByteArray());
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
throw new CanalClientException(e);
|
|
throw new CanalClientException(e);
|
|
}
|
|
}
|