Running the CDC adapter

Prerequisites

  • Java installation (min Java 11)

  • A running database (supported by Debezium 2.5.4.Final) to fetch data from. See an example

  • A running Diffusion server (or server cluster)

Download the adapter bundle

Download this zip file that contains the adapter jar and other resources.

Run script

The adapter can be started with any of the following:

  • using bootstrap configuration only

  • using a configuration file only

  • with a combination of both

Provided scripts can be used to run the application, which runs the executable jar of the CDC adapter.

Starting with bootstrap configuration only

To start the adapter with the minimum required bootstrap configuration:

  • Run the cdc-adapter-bootstrap.sh script in the bin directory.

The Diffusion connection details can be updated as needed in the script. By default, it is set to use the connection details of a local Diffusion server.

./bin/cdc-adapter-bootstrap.sh
If the adapter is initiated with only the bootstrap configuration, it will establish a session with the Diffusion server. Nevertheless, to fully leverage its functionality, a service needs to be added for data consumption or publication. Therefore, after starting the adapter with the bootstrap configuration, use the Diffusion management console to add a service to commence data publication or consumption.

Starting with a configuration file

To start the adapter with a configuration file:

  • Run the cdc-adapter.sh script in the bin directory.

This script uses a sample configuration file, configuration.json, which is located in the example folder. The configuration file contains general Gateway Framework configuration along with configuration that is specific to the CDC adapter - contained within the application sections. Modify this file as needed to configure services and sharedConfigs.

./bin/cdc-adapter.sh

The JSON schema files for service types and sharedConfig type in the schema folder can be used to understand the configuration requirements in more detail.

For Windows, use the cdc-adapter.bat script or cdc-adapter-bootstrap.bat instead.

.\bin\cdc-adapter.bat

Run the docker image

To run the docker image:

  1. Pull the docker image.

    docker pull pushtechnology/gateway-cdc-adapter:2.0.0
  2. Run the image as follows:

    1. With minimal bootstrap configuration:

      docker run \
        -e gateway.diffusion.url=ws://90.247.210.62:8080 \
        -e gateway.diffusion.principal=admin \
        -e gateway.diffusion.password=password \
        pushtechnology/gateway-cdc-adapter:2.0.0
    2. With a configuration file:

      docker run \
        --mount type=bind,source=configuration.json,target=/opt/cdc-adapter/configuration.json \
        -e gateway.config.file=/opt/cdc-adapter/configuration.json \
        pushtechnology/gateway-cdc-adapter:2.0.0
Here, an external config file is mounted in /opt/cdc-adapter/configuration.json path, and is configured as a value for the gateway.config.file environment variable, to set the configuration file for the Java application.

The docker image allows setting the EXTRA_JAVA_OPTIONS environment variable, which can be set to specify any additional JVM option or override the pre-configured JVM options for the docker container.