Skip to content

Latest commit

 

History

History
46 lines (29 loc) · 2.56 KB

File metadata and controls

46 lines (29 loc) · 2.56 KB

CDC Debezium Supplier

This module provides a CDC Debezium supplier that can be reused and composed in other applications. The Supplier uses the Debezium library. cdcSupplier is implemented as a java.util.function.Supplier. This supplier gives you a reactive stream from CDC sources. The supplier has a signature of Supplier<Flux<Message<?>>>. Users have to subscribe to this Flux and then receive the data.

Change Data Capture (CDC) source that captures and streams change events from various databases. Currently, it supports MySQL, PostgreSQL, MongoDB, Oracle and SQL Server databases.

Build upon Debezium Embedded Connector, the CDC Source allows capturing and streaming database changes over different message binders such Apache Kafka, RabbitMQ and all Spring Cloud Stream supporter brokers.

Beans for injection

You can import the CdcSupplierConfiguration in the application and then inject the following bean.

cdcSupplier

You need to inject this as Supplier<Flux<Message<?>>>.

You can use cdcSupplier as a qualifier when injecting.

Once injected, you can use the get method of the Supplier to invoke it and then subscribe to the returned Flux.

Configuration Options

All configuration properties are prefixed with cdc. Use the cdc.config. prefix to inject native, Debezium properties. Convenient shortcuts for the most frequently used Debezium properties are available. Uses BackingOffsetStore configuration, based on the MetadataStore service. Later provides various microservices friendly ways for storing the offset metadata.

For more information on the various options available, please see:

Examples

See this test suite for the various ways, this supplier is used.

Other usage

See this README where this supplier is used to create a Spring Cloud Stream CDC Source.

Also check README to see how the core CDC can be used a Spring Boot Starter.