Search in sources :

Example 1 with TestKafkaBroker

use of org.apache.ignite.stream.kafka.TestKafkaBroker in project ignite by apache.

the class IgniteSourceConnectorTest method beforeTest.

/** {@inheritDoc} */
@Override
protected void beforeTest() throws Exception {
    kafkaBroker = new TestKafkaBroker();
    WorkerConfig workerCfg = new StandaloneConfig(makeWorkerProps());
    MemoryOffsetBackingStore offBackingStore = new MemoryOffsetBackingStore();
    offBackingStore.configure(workerCfg);
    worker = new Worker(WORKER_ID, new SystemTime(), workerCfg, offBackingStore);
    worker.start();
    herder = new StandaloneHerder(worker);
    herder.start();
}
Also used : StandaloneHerder(org.apache.kafka.connect.runtime.standalone.StandaloneHerder) WorkerConfig(org.apache.kafka.connect.runtime.WorkerConfig) Worker(org.apache.kafka.connect.runtime.Worker) TestKafkaBroker(org.apache.ignite.stream.kafka.TestKafkaBroker) StandaloneConfig(org.apache.kafka.connect.runtime.standalone.StandaloneConfig) MemoryOffsetBackingStore(org.apache.kafka.connect.storage.MemoryOffsetBackingStore) SystemTime(org.apache.kafka.common.utils.SystemTime)

Example 2 with TestKafkaBroker

use of org.apache.ignite.stream.kafka.TestKafkaBroker in project ignite by apache.

the class IgniteSinkConnectorTest method beforeTest.

/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override
protected void beforeTest() throws Exception {
    kafkaBroker = new TestKafkaBroker();
    for (String topic : TOPICS) kafkaBroker.createTopic(topic, PARTITIONS, REPLICATION_FACTOR);
    WorkerConfig workerCfg = new StandaloneConfig(makeWorkerProps());
    OffsetBackingStore offBackingStore = mock(OffsetBackingStore.class);
    offBackingStore.configure(workerCfg);
    worker = new Worker(WORKER_ID, new SystemTime(), workerCfg, offBackingStore);
    worker.start();
    herder = new StandaloneHerder(worker);
    herder.start();
}
Also used : OffsetBackingStore(org.apache.kafka.connect.storage.OffsetBackingStore) StandaloneHerder(org.apache.kafka.connect.runtime.standalone.StandaloneHerder) WorkerConfig(org.apache.kafka.connect.runtime.WorkerConfig) Worker(org.apache.kafka.connect.runtime.Worker) TestKafkaBroker(org.apache.ignite.stream.kafka.TestKafkaBroker) StandaloneConfig(org.apache.kafka.connect.runtime.standalone.StandaloneConfig) SystemTime(org.apache.kafka.common.utils.SystemTime)

Aggregations

TestKafkaBroker (org.apache.ignite.stream.kafka.TestKafkaBroker)2 SystemTime (org.apache.kafka.common.utils.SystemTime)2 Worker (org.apache.kafka.connect.runtime.Worker)2 WorkerConfig (org.apache.kafka.connect.runtime.WorkerConfig)2 StandaloneConfig (org.apache.kafka.connect.runtime.standalone.StandaloneConfig)2 StandaloneHerder (org.apache.kafka.connect.runtime.standalone.StandaloneHerder)2 MemoryOffsetBackingStore (org.apache.kafka.connect.storage.MemoryOffsetBackingStore)1 OffsetBackingStore (org.apache.kafka.connect.storage.OffsetBackingStore)1