use of com.example.canal.processor.UserEntryProcessor in project java-example by 1479005017.
the class CanalTest2 method test.
@Test
public void test() {
CanalProperties properties = new CanalProperties();
SocketAddress address = new InetSocketAddress(properties.getHost(), properties.getPort());
CanalConnector connector = CanalConnectors.newSingleConnector(address, properties.getDestination(), properties.getUsername(), properties.getPassword());
UserEntryProcessor userEntryProcessor = new UserEntryProcessor();
CanalMessageHandler handler = new CanalMessageHandler();
handler.setProperties(properties);
handler.setConnector(connector);
handler.addEntryProcessor(userEntryProcessor);
handler.start();
while (Thread.activeCount() > 1) Thread.yield();
}
Aggregations