Full and usable samples can be found under test/config/
sourcePath
: write a java class implementsMethodFilter
to handleSyncData
- Open a new maven project and import the latest dependency (not import other dependency):
<dependency> <groupId>com.github.zzt93</groupId> <artifactId>syncer-data</artifactId> <version>1.0.2-SNAPSHOT</version> </dependency>
- Write a class implement
MethodFilter
without package name: use all api provided bySyncData
to do any change you like
import com.github.zzt93.syncer.data.SyncData; import com.github.zzt93.syncer.data.util.MethodFilter; import com.github.zzt93.syncer.data.util.SyncUtil; import java.util.List; /** * @author zzt */ public class Simplest implements MethodFilter { @Override public void filter(List<SyncData> list) { SyncData sync = list.get(0); SyncUtil.unsignedByte(sync, "tinyint"); SyncUtil.unsignedByte(sync, "type"); } }
- config it:
filter: sourcePath: /data/config/consumer/ColdFilter.java
- debug code
- add log by slf4j logger
- how to add breakpoint to debug?