Search in sources :

Example 1 with DatabaseOffsetKafkaStore

use of io.eventuate.local.db.log.common.DatabaseOffsetKafkaStore in project eventuate-local by eventuate-local.

the class AbstractDatabaseOffsetKafkaStoreTest method generateAndSaveBinlogFileOffset.

private BinlogFileOffset generateAndSaveBinlogFileOffset() throws InterruptedException {
    BinlogFileOffset bfo = generateBinlogFileOffset();
    DatabaseOffsetKafkaStore binlogOffsetKafkaStore = getDatabaseOffsetKafkaStore(eventuateConfigurationProperties.getDbHistoryTopicName(), "mySqlBinaryLogClientName");
    binlogOffsetKafkaStore.save(bfo);
    Thread.sleep(5000);
    BinlogFileOffset savedBfo = binlogOffsetKafkaStore.getLastBinlogFileOffset().get();
    assertEquals(bfo, savedBfo);
    binlogOffsetKafkaStore.stop();
    return savedBfo;
}
Also used : BinlogFileOffset(io.eventuate.local.common.BinlogFileOffset) DatabaseOffsetKafkaStore(io.eventuate.local.db.log.common.DatabaseOffsetKafkaStore)

Example 2 with DatabaseOffsetKafkaStore

use of io.eventuate.local.db.log.common.DatabaseOffsetKafkaStore in project eventuate-local by eventuate-local.

the class AbstractDatabaseOffsetKafkaStoreTest method shouldGetEmptyOptionalFromEmptyTopic.

@Test
public void shouldGetEmptyOptionalFromEmptyTopic() {
    DatabaseOffsetKafkaStore databaseOffsetKafkaStore = getDatabaseOffsetKafkaStore(UUID.randomUUID().toString(), "mySqlBinaryLogClientName");
    databaseOffsetKafkaStore.getLastBinlogFileOffset().isPresent();
    databaseOffsetKafkaStore.stop();
}
Also used : DatabaseOffsetKafkaStore(io.eventuate.local.db.log.common.DatabaseOffsetKafkaStore) AbstractCdcTest(io.eventuate.local.test.util.AbstractCdcTest) Test(org.junit.Test)

Example 3 with DatabaseOffsetKafkaStore

use of io.eventuate.local.db.log.common.DatabaseOffsetKafkaStore in project eventuate-local by eventuate-local.

the class AbstractDatabaseOffsetKafkaStoreTest method assertLastRecordEquals.

private void assertLastRecordEquals(BinlogFileOffset binlogFileOffset) {
    DatabaseOffsetKafkaStore binlogOffsetKafkaStore = getDatabaseOffsetKafkaStore(eventuateConfigurationProperties.getDbHistoryTopicName(), "mySqlBinaryLogClientName");
    BinlogFileOffset lastRecord = binlogOffsetKafkaStore.getLastBinlogFileOffset().get();
    assertEquals(binlogFileOffset, lastRecord);
    binlogOffsetKafkaStore.stop();
}
Also used : BinlogFileOffset(io.eventuate.local.common.BinlogFileOffset) DatabaseOffsetKafkaStore(io.eventuate.local.db.log.common.DatabaseOffsetKafkaStore)

Aggregations

DatabaseOffsetKafkaStore (io.eventuate.local.db.log.common.DatabaseOffsetKafkaStore)3 BinlogFileOffset (io.eventuate.local.common.BinlogFileOffset)2 AbstractCdcTest (io.eventuate.local.test.util.AbstractCdcTest)1 Test (org.junit.Test)1