fixed batch sync dml

This commit is contained in:
agapple
2018-11-20 19:01:07 +08:00
parent a7be9c75f9
commit 26700f3005
7 changed files with 104 additions and 36 deletions

View File

@@ -1,5 +1,7 @@
package com.alibaba.otter.canal.client.adapter.logger;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -27,7 +29,12 @@ public class LoggerAdapterExample implements OuterAdapter {
}
@Override
public void sync(List<Dml> dmls) {
for (Dml dml : dmls) {
sync(dml);
}
}
public void sync(Dml dml) {
logger.info("DML: {}", JSON.toJSONString(dml, SerializerFeature.WriteMapNullValue));
}