Как внедрить debezium в Java-приложение для сбора данных об изменениях Oracle? - PullRequest
0 голосов
/ 12 октября 2018

Я использую debezium в своем java-приложении для получения изменений от Oracle 12c.База данных оракула доступна на локальном хосте: 1521.Ниже приведен соответствующий код Java.

    // Define the configuration for the embedded and Oracle connector ...
    Configuration config = Configuration.create()
            .with("connector.class", "io.debezium.connector.oracle.OracleConnector")
            .with("tasks.max", "1")
            .with("offset.storage",
                    "org.apache.kafka.connect.storage.FileOffsetBackingStore")
            .with("offset.storage.file.filename",
                    "/home/username/oracleLogs/offset.dat")
            .with("offset.flush.interval.ms", 10000)
            .with("name", "oracle-debezium-connector")
            .with("database.hostname", "localhost")
            .with("database.port", "1521")
            .with("database.user", "c##xstrm")
            .with("database.password", "xs")
            .with("database.sid", "ORCLCDB")
            .with("database.server.name", "oracle-debezium-server")
            .with("database.out.server.name", "dbzxout")
            .with("database.history",
                    "io.debezium.relational.history.FileDatabaseHistory")
            .with("database.history.file.filename",
                    "/home/username/oracleLogs/dbhistory.dat")
            .with("database.dbname", "ORCLCDB")
            .with("database.pdb.name", "ORCLPDB1")
            .build();

    // Create the engine with this configuration ...
    EmbeddedEngine engine = EmbeddedEngine.create()
            .using(config)
            .notifying(this::handleEvent)
            .build();

    // Run the engine asynchronously ...
    ExecutorService executor = Executors.newSingleThreadExecutor();
    executor.execute(engine);

Обратите внимание, что база данных Oracle настроена так, как указано здесь .Также ojdbc8.jar и xstreams.jar, полученные из Oracle Instant Client , были импортированы в проект java.

Когда приведенный выше код выполняется, он выдает следующий вывод, даже когда база данных Oracle выключена.Изменения также не фиксируются.

28 [pool-1-thread-1] INFO org.apache.kafka.connect.storage.FileOffsetBackingStore  - Starting FileOffsetBackingStore with file /home/username/oracleLogs/offset.dat

Что я здесь не так делаю?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...