Skip to content

Commit

Permalink
DBZ-6049 Move debezium-server to https://github.com/debezium/debezium…
Browse files Browse the repository at this point in the history
  • Loading branch information
jpechane committed Jan 31, 2023
1 parent a2f15ab commit 7d5179b
Show file tree
Hide file tree
Showing 175 changed files with 56 additions and 14,924 deletions.
104 changes: 55 additions & 49 deletions .github/workflows/debezium-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ jobs:
postgresql-changed: ${{ steps.changed-files-postgresql.outputs.any_changed }}
oracle-changed: ${{ steps.changed-files-oracle.outputs.any_changed }}
sqlserver-changed: ${{ steps.changed-files-sqlserver.outputs.any_changed }}
debezium-server-changed: ${{ steps.changed-files-debezium-server.outputs.any_changed }}
outbox-changed: ${{ steps.changed-files-outbox.outputs.any_changed }}
rest-extension-changed: ${{ steps.changed-files-rest-extension.outputs.any_changed }}
schema-generator-changed: ${{ steps.changed-files-schema-generator.outputs.any_changed }}
Expand Down Expand Up @@ -97,13 +96,6 @@ jobs:
files: |
debezium-connector-sqlserver/**
- name: Get modified files (Debezium Server)
id: changed-files-debezium-server
uses: tj-actions/changed-files@v35.4.4
with:
files: |
debezium-server/**
- name: Get modified files (Quarkus Outbox)
id: changed-files-outbox
uses: tj-actions/changed-files@v35.4.4
Expand Down Expand Up @@ -457,47 +449,6 @@ jobs:
-Dmaven.wagon.httpconnectionManager.ttlSeconds=120
-Ddebezium.test.records.waittime=10
build_debezium_server:
needs: [check_style, file_changes]
if: ${{ needs.file_changes.outputs.common-changed == 'true' || needs.file_changes.outputs.debezium-server-changed == 'true' }}
name: "Debezium Server"
runs-on: ubuntu-latest
steps:
- name: Checkout Action
uses: actions/checkout@v3

- name: Set up Java 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17

- name: Cache Maven Repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: maven-debezium-test-build-${{ hashFiles('**/pom.xml') }}
restore-keys: |
maven-debezium-test-build-${{ hashFiles('**/pom.xml') }}
- name: Build Debezium Server
run: >
./mvnw clean install -Dquick -B -pl debezium-testing/debezium-testing-testcontainers,debezium-server,:debezium-storage-redis -Pserver-ci -am -amd
-Dcheckstyle.skip=true
-Dformat.skip=true
-Dhttp.keepAlive=false
-Dmaven.wagon.http.pool=false
-Dmaven.wagon.httpconnectionManager.ttlSeconds=120
-DskipITs=true
-DskipTests=true
- name: Test Debezium Server
run: >
./mvnw install -B -pl debezium-server -Pserver-ci -amd
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
-Dmaven.wagon.http.pool=false
-Dmaven.wagon.httpconnectionManager.ttlSeconds=120
build_outbox:
needs: [check_style, file_changes]
if: ${{ needs.file_changes.outputs.common-changed == 'true' || needs.file_changes.outputs.outbox-changed == 'true' }}
Expand Down Expand Up @@ -888,6 +839,61 @@ jobs:
-Dmaven.wagon.http.pool=false
-Dmaven.wagon.httpconnectionManager.ttlSeconds=120
build_debezium_server:
needs: [check_style, file_changes]
if: ${{ needs.file_changes.outputs.common-changed == 'true' }}
name: "Debezium Server"
runs-on: ubuntu-latest
steps:
- name: Checkout Action (Core)
uses: actions/checkout@v3
with:
path: core

- name: Checkout Action (Debezium Server)
uses: actions/checkout@v3
with:
repository: debezium/debezium-server
path: server

- name: Set up Java 17
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 17

# We explicitly use only the hash of the POM files from the core repository by default
# For this build, we do not care if there are or are not changes in the sibling repository since this
# job will only ever fire if there are changes in the common paths identified in the files_changed job.
- name: Cache Maven Repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: maven-debezium-test-build-${{ hashFiles('core/**/pom.xml') }}
restore-keys: |
maven-debezium-test-build-${{ hashFiles('core/**/pom.xml') }}
- name: Build Debezium (Core)
run: >
./core/mvnw clean install -f core/pom.xml
-DskipTests=true
-DskipITs=true
-Dcheckstyle.skip=true
-Dformat.skip=true
-Drevapi.skip
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
-Dmaven.wagon.http.pool=false
-Dmaven.wagon.httpconnectionManager.ttlSeconds=120
- name: Build Debezium Server
run: >
./core/mvnw clean install -f server/pom.xml -Passembly
-Dcheckstyle.skip=true
-Dformat.skip=true
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
-Dmaven.wagon.http.pool=false
-Dmaven.wagon.httpconnectionManager.ttlSeconds=120
build_ui:
needs: [check_style, file_changes]
if: ${{ needs.file_changes.outputs.debezium-ui-changed == 'true' }}
Expand Down
96 changes: 1 addition & 95 deletions debezium-server/README.md
Original file line number Diff line number Diff line change
@@ -1,95 +1 @@
# Debezium Server

Debezium Server is a standalone Java application built on Qurkus framework.
The application itself contains the `core` module and a set of modules responsible for communication with different target systems.

The per-module integration tests depend on the availability of the external services.
It is thus recommended to execute integration tests per-module and set-up necessary pre-requisities beforehand.

Note: running these tests against external infrastructure may incur cost with your cloud provider.
We're not going to pay your AWS/GCP/Azure bill.

## Amazon Kinesis

* Execute `aws configure` as described in AWS CLI [getting started](https://github.com/aws/aws-cli#getting-started) guide and setup the account.
* Create Kinesis stream `aws kinesis create-stream --stream-name testc.inventory.customers --shard-count 1`
* Build the module and execute the tests `mvn clean install -DskipITs=false -am -pl debezium-server-kinesis`
* Remove the stream `aws kinesis delete-stream --stream-name testc.inventory.customers`

## Google Cloud Pub/Sub

* Login into your Google Cloud account using `gcloud auth application-default login` as described in the [documentation](https://cloud.google.com/sdk/gcloud/reference/auth/application-default).
* Build the module and execute the tests `mvn clean install -DskipITs=false -am -pl debezium-server-pubsub`

## Azure Event Hubs

Login into your Azure account and create a resource group, e.g. on the CLI:

```shell
az login
az group create --name eventhubstest --location westeurope
```

### Create an Event Hubs namespace

Create an [Event Hubs namespace](https://docs.microsoft.com/azure/event-hubs/event-hubs-features#namespace). Check the documentation for options on how do this using the [Azure Portal](https://docs.microsoft.com/azure/event-hubs/event-hubs-create#create-an-event-hubs-namespace), [Azure CLI](https://docs.microsoft.com/azure/event-hubs/event-hubs-quickstart-cli#create-an-event-hubs-namespace) etc., e.g. on the CLI:

```shell
az eventhubs namespace create --name debezium-test --resource-group eventhubstest -l westeurope
```

### Create an Event Hub

Create an Event Hub (equivalent to a topic) with `one` partition. Check the documentation for options on how do this using the [Azure Portal](https://docs.microsoft.com/azure/event-hubs/event-hubs-create#create-an-event-hub), [Azure CLI](https://docs.microsoft.com/azure/event-hubs/event-hubs-quickstart-cli#create-an-event-hub) etc. , e.g. on the CLI:

```shell
az eventhubs eventhub create --name debezium-test-hub --resource-group eventhubstest --namespace-name debezium-test
```

### Build the module

[Get the Connection string](https://docs.microsoft.com/azure/event-hubs/event-hubs-get-connection-string) required to communicate with Event Hubs. The format is: `Endpoint=sb://<NAMESPACE>/;SharedAccessKeyName=<ACCESS_KEY_NAME>;SharedAccessKey=<ACCESS_KEY_VALUE>`.
E.g. on the CLI:

```shell
az eventhubs namespace authorization-rule keys list --resource-group eventhubstest --namespace-name debezium-test --name RootManageSharedAccessKey
```

Set environment variables required for tests:

```shell
export EVENTHUBS_CONNECTION_STRING=<Event Hubs connection string>
export EVENTHUBS_NAME=<name of the Event hub created in previous step>
```

Execute the tests:

```shell
mvn clean install -DskipITs=false -Deventhubs.connection.string=$EVENTHUBS_CONNECTION_STRING -Deventhubs.hub.name=$EVENTHUBS_NAME -am -pl :debezium-server-eventhubs
```

### Examine Events in the Event Hub

E.g. using kafkacat. Create _kafkacat.conf_:

```shell
metadata.broker.list=debezium-test.servicebus.windows.net:9093
security.protocol=SASL_SSL
sasl.mechanisms=PLAIN
sasl.username=$ConnectionString
sasl.password=Endpoint=sb://debezium-test.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=<access key>
```

Start consuming events:

export KAFKACAT_CONFIG=<path to kafkacat.conf>
kafkacat -b debezium-test.servicebus.windows.net:9093 -t debezium-test-hub

### Clean up

Delete the Event Hubs namespace and log out, e.g. on the CLI:

```shell
az group delete -n eventhubstest
az logout
```
Debezium Server has been moved to a [separate repository](https://github.com/debezium/debezium-server/).
Loading

0 comments on commit 7d5179b

Please sign in to comment.