kafka-connect-cosmosdb

Developer Walkthrough and Project Setup

Setup

Github Codespaces is the easiest way to evaluate this repository as all of the prerequisites are automatically installed. If you want to setup locally instead of through Codespaces, using a Dev Container with Visual Studio Code is recommended as the Java based prerequisites are automatically installed.

Github Codespaces

Open with codespaces

New codespace

Codespaces Menu Button

To manage your codespaces, visit the Github Codespaces page.

Dev Container using Visual Studio Code

Prerequisites (Dev Container setup)

Ensure you have the following prerequisites installed.

Dev Container Installation

Setup a Dev Container for the kafka-connect-cosmosdb repo by cloning it in a Docker container.

Open Remote Explorer

Dev Container Progress

You can manage your dev containers from the Remote Explorer menu from the left sidebar of Visual Studio Code (as shown previously in the first step of installation).

For more information on working with Dev Containers in Visual Studio Code, refer to the documentation.

Manual Setup

Prerequisites (manual setup)

Ensure you have the following prerequisites installed.

Manual Installation

Clone the Github repo microsoft/kafka-connect-cosmosdb GitHub repository.


git clone https://github.com/microsoft/kafka-connect-cosmosdb.git

Testing

Unit Tests

Navigate to root project directory and execute unit tests


cd kafka-connect-cosmosdb
mvn clean test

Integration Tests

To run the integration tests, you will need to first setup the following resources:

Update the sink and source connectors configuration files located in src/test/resources by filling out the values for connect.cosmos.connection.endpoint and connect.cosmos.master.key, which you should have saved from the Cosmos DB setup guide.

Navigate to root project directory and execute the integration tests


cd kafka-connect-cosmosdb

# copy the template connector configs into src/test/resources
# you will need to update the configs for the Cosmos values as mentioned above

cp src/docker/resources/sink.example.json src/test/resources/sink.config.json
cp src/docker/resources/source.example.json src/test/resources/source.config.json

# run the integration tests
mvn clean test-compile failsafe:integration-test

Configure Confluent Platform, Cosmos DB and validate Kafka Connectors