From 41b7fbe78e3543718c65a3ddbe463cc49375796c Mon Sep 17 00:00:00 2001 From: Gunnar Morling Date: Tue, 29 Jan 2019 17:05:56 +0100 Subject: [PATCH] Adding note on testing Postgres connector with external DB --- README.md | 9 ++++++--- debezium-connector-postgres/pom.xml | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1c185df13..42e63e4ae 100644 --- a/README.md +++ b/README.md @@ -48,8 +48,6 @@ Data is often stored in multiple places, especially when it is used for differen The [Command Query Responsibility Separation (CQRS)](http://martinfowler.com/bliki/CQRS.html) architectural pattern uses a one data model for updating and one or more other data models for reading. As changes are recorded on the update-side, those changes are then processed and used to update the various read representations. As a result CQRS applications are usually more complicated, especially when they need to ensure reliable and totally-ordered processing. Debezium and CDC can make this more approachable: writes are recorded as normal, but Debezium captures those changes in durable, totally ordered streams that are consumed by the services that asynchronously update the read-only views. The write-side tables can represent domain-oriented entities, or when CQRS is paired with [Event Sourcing](http://martinfowler.com/eaaDev/EventSourcing.html) the write-side tables are the append-only event log of commands. - - ## Building Debezium The following software is required to work with the Debezium codebase and build it locally: @@ -66,7 +64,6 @@ See the links above for installation instructions on your platform. You can veri $ mvn -version $ docker --version - ### Why Docker? Many open source software projects use Git, Java, and Maven, but requiring Docker is less common. Debezium is designed to talk to a number of external systems, such as various databases and services, and our integration tests verify Debezium does this correctly. But rather than expect you have all of these software systems installed locally, Debezium's build system uses Docker to automatically download or create the necessary images and start containers for each of the systems. The integration tests can then use these services and verify Debezium behaves as expected, and when the integration tests finish, Debezium's build will automatically stop any containers that it started. @@ -120,6 +117,12 @@ To run the integration tests of the PG connector using wal2json, enable the "wal A few tests currently don't pass when using the wal2json plug-in. Look for references to the types defined in `io.debezium.connector.postgresql.DecoderDifferences` to find these tests. +### Running tests of the Postgres connector against an external database, e.g. Amazon RDS + + $ mvn clean install -pl debezium-connector-postgres -Pwal2json-decoder \ + -Ddocker.skip.build=true -Ddocker.skip.run=true -Dpostgres.host= \ + -Dpostgres.user= -Dpostgres.password= + ## Contributing The Debezium community welcomes anyone that wants to help out in any way, whether that includes reporting problems, helping with documentation, or contributing code changes to fix bugs, add tests, or implement new features. See [this document](CONTRIBUTE.md) for details. diff --git a/debezium-connector-postgres/pom.xml b/debezium-connector-postgres/pom.xml index d90a4e8d7..cf5190f17 100644 --- a/debezium-connector-postgres/pom.xml +++ b/debezium-connector-postgres/pom.xml @@ -17,6 +17,7 @@ work on all platforms. We'll set some of these as system properties during integration testing. --> 9.6 + ${docker.host.address} 5432 postgres postgres @@ -213,7 +214,7 @@ true - ${docker.host.address} + ${postgres.host} ${postgres.port} ${postgres.user} ${postgres.password}