Search in sources :

Example 6 with CanalInstanceGenerator

use of com.alibaba.otter.canal.instance.core.CanalInstanceGenerator in project canal by alibaba.

the class DefaultSpringInstanceTest method testInstance.

@Test
public void testInstance() {
    CanalInstanceGenerator generator = (CanalInstanceGenerator) context.getBean("canalInstanceGenerator");
    CanalInstance canalInstance = generator.generate("instance");
    Assert.notNull(canalInstance);
    canalInstance.start();
    try {
        Thread.sleep(10 * 1000);
    } catch (InterruptedException e) {
    }
    canalInstance.stop();
}
Also used : CanalInstance(com.alibaba.otter.canal.instance.core.CanalInstance) CanalInstanceGenerator(com.alibaba.otter.canal.instance.core.CanalInstanceGenerator) Test(org.junit.Test)

Aggregations

CanalInstance (com.alibaba.otter.canal.instance.core.CanalInstance)6 CanalInstanceGenerator (com.alibaba.otter.canal.instance.core.CanalInstanceGenerator)6 CanalInstanceWithManager (com.alibaba.otter.canal.instance.manager.CanalInstanceWithManager)3 Canal (com.alibaba.otter.canal.instance.manager.model.Canal)3 Test (org.junit.Test)3 Before (org.junit.Before)2 CanalException (com.alibaba.otter.canal.common.CanalException)1 MediaHAController (com.alibaba.otter.canal.extend.ha.MediaHAController)1 HAMode (com.alibaba.otter.canal.instance.manager.model.CanalParameter.HAMode)1 CanalEventParser (com.alibaba.otter.canal.parse.CanalEventParser)1 CanalHAController (com.alibaba.otter.canal.parse.ha.CanalHAController)1 MysqlEventParser (com.alibaba.otter.canal.parse.inbound.mysql.MysqlEventParser)1 AuthenticationInfo (com.alibaba.otter.canal.parse.support.AuthenticationInfo)1 ClientIdentity (com.alibaba.otter.canal.protocol.ClientIdentity)1 CanalServerWithEmbedded (com.alibaba.otter.canal.server.embedded.CanalServerWithEmbedded)1 AbstractCanalEventSink (com.alibaba.otter.canal.sink.AbstractCanalEventSink)1 CanalEventSink (com.alibaba.otter.canal.sink.CanalEventSink)1 Pipeline (com.alibaba.otter.shared.common.model.config.pipeline.Pipeline)1 ByteString (com.google.protobuf.ByteString)1