Java Code Examples for com.alibaba.otter.canal.instance.core.CanalInstance#start()
The following examples show how to use
com.alibaba.otter.canal.instance.core.CanalInstance#start() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CanalServerWithEmbedded.java From canal-1.1.3 with Apache License 2.0 | 6 votes |
public void start(final String destination) { final CanalInstance canalInstance = canalInstances.get(destination); if (!canalInstance.isStart()) { try { MDC.put("destination", destination); if (metrics.isRunning()) { metrics.register(canalInstance); } // 启动canal instance canalInstance.start(); logger.info("start CanalInstances[{}] successfully", destination); } finally { MDC.remove("destination"); } } }
Example 2
Source File: MemorySpringInstanceTest.java From canal-1.1.3 with Apache License 2.0 | 5 votes |
@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(); }
Example 3
Source File: GroupSpringInstanceTest.java From canal-1.1.3 with Apache License 2.0 | 5 votes |
@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(); }
Example 4
Source File: DefaultSpringInstanceTest.java From canal-1.1.3 with Apache License 2.0 | 5 votes |
@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(); }
Example 5
Source File: MemorySpringInstanceTest.java From canal with Apache License 2.0 | 5 votes |
@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(); }
Example 6
Source File: GroupSpringInstanceTest.java From canal with Apache License 2.0 | 5 votes |
@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(); }
Example 7
Source File: DefaultSpringInstanceTest.java From canal with Apache License 2.0 | 5 votes |
@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(); }
Example 8
Source File: CanalServerWithEmbedded.java From canal with Apache License 2.0 | 5 votes |
public void start(final String destination) { final CanalInstance canalInstance = canalInstances.get(destination); if (!canalInstance.isStart()) { try { MDC.put("destination", destination); if (metrics.isRunning()) { metrics.register(canalInstance); } canalInstance.start(); logger.info("start CanalInstances[{}] successfully", destination); } finally { MDC.remove("destination"); } } }