Configuration

Store Debezium state

qianmoQqianmoQ· 更新于 2026-09-23· 阅读 190 分钟· 0 次阅读

登录后可跨设备保存划线和私人笔记登录

Storing state of a Debezium connector

Table of Contents

Overview

Debezium connectors require persistent storage to preserve their state between restarts. All connectors require a mechanism to provide persistent storage for the offsets. In addition, connectors such as Db2, MySQL, Oracle, and SQL Server, require additional storage for their so-called internal schema history, which records changes to table schema in the database.

Offset storage is provided automatically for deployments within the Kafka Connect runtime through one of the following mechanisms:

Kafka offset storeProvides storage for Kafka Connect distributed.
File offset storeProvides storage for Kafka Connect standalone.

If you run a connector in Debezium Engine or Debezium Server, you must explicitly configure the offset store. For connectors that work with schema-based databases, you configure internal schema history storage by setting connector properties.

Kafka

Debezium can use Kafka to store its state, including source offsets and schema history. Connectors implement KafkaOffsetBackingStore to store offsets in a Kafka topic (for example, connect-offsets). These offsets ensure that after a connector restarts, it is able to resume reading from the correct position. Connectors store their schema history in a separate compacted topic, such as schema-changes.inventory.

Offset Store

PropertyDefaultDescription
offset.storageNo defaultMust be set to org.apache.kafka.connect.storage.KafkaOffsetBackingStore.
offset.storage.topicNo defaultSpecifies the Kafka topic where the connector stores its offsets. To ensure that the topic retains the latest offset information, you must enable log compaction for this topic.
offset.storage.partitions25Specifies the number of partitions for the offset storage topic. Ensure that the value of this setting aligns with the partitioning strategy of the Kafka cluster.
offset.storage.replication.factor3Sets the replication factor for the offset storage topic. Replicating data across multiple brokers improves fault tolerance.

Internal schema history store

PropertyDefaultDescription
schema.history.internalNo defaultMust be set to io.debezium.storage.kafka.history.KafkaSchemaHistory.
schema.history.internal.kafka.topicNo defaultThe name of the topic that stores the database schema history.
schema.history.internal.kafka.bootstrap.serversNo defaultA list of host and port pairs that the connector uses to establish the initial connection to the Kafka cluster to retrieve its database schema history. This value must match the connection settings that the Kafka Connect process uses to connect to the Kafka cluster.
schema.history.internal.kafka.recovery.poll.interval.ms100Specifies the time, in milliseconds, that the connector waits between polling requests for persisted data during recovery.
schema.history.internal.kafka.recovery.attempts100Specifies the number of consecutive unsuccessful attempts to retrieve schema history data from Kafka that the connector allows. Recovery attempts stop after the number of attempts exceeds this value. The maximum time that the connector waits after it is unable to retrieve data is recovery.attempts x recovery.poll.interval.ms.
schema.history.internal.kafka.query.timeout.ms3Specifies the time, in milliseconds, that the connector waits for a response after the Kafka AdminClient submits a request to fetch cluster information before the request times out.
schema.history.internal.kafka.create.timeout.ms30Specifies the time, in milliseconds, that the connector waits for a response after the Kafka AdminClient submits a request to create a Kafka history topic before the request times out.
schema.history.internal.producer.*No DefaultPass-through properties prefix for configuring how producer clients interact with schema history topics.
schema.history.internal.consumer.*No DefaultPass-through properties prefix for configuring how consumer clients interact with schema history topics.

File

It’s possible to persist the position (offsets) of the connector in a local file on disk. These offsets ensure that after a connector restarts, Debezium can resume reading from the last read position. File storage provides a simple, fast mechanism for storing offsets that is ideal for single-node applications or testing scenarios.

Offset Store

PropertyDefaultDescription
offset.storageNo defaultMust be set to org.apache.kafka.connect.storage.FileOffsetBackingStore
offset.storage.file.filenameNo defaultThe path to the file where Debezium stores source connector offsets.
offset.flush.interval.ms6000msSpecifies the time, in milliseconds, between attempts to flush the current offset state to the configured offsets file.

Internal schema history store

PropertyDefaultDescription
schema.history.internalNo defaultMust be set to io.debezium.storage.file.history.FileSchemaHistory
schema.history.internal.fileNo defaultThe path to the file where Debezium records the database schema history.

Memory

MemoryOffsetBackingStore is a volatile, in-memory store that Debezium Embedded uses to track source offsets. Storing offsets in memory preserves the offset state only during the application’s runtime. Offset records are lost if the connector shuts down or crashes. Memory storage is ideal for testing, or for short-lived tasks, but it is not suitable for production environments that require persistent offsets.

Offset Store

PropertyDefaultDescription
offset.storageNo defaultMust be set to org.apache.kafka.connect.storage.MemoryOffsetBackingStore

Internal schema history store

PropertyDefaultDescription
schema.history.internalNo defaultMust be set to io.debezium.relational.history.MemorySchemaHistory

JDBC

The store uses an arbitrary relational database to store the offset data. You must provide the JDBC driver for the database. Debezium can store data in the same source database from which it captures events, or you can configure it to use a different database.

Debezium provides pre-configured DML and DDL statements. You can use these default statements, or you can override the defaults with your own statements to provide compatibility with database dialects or to customize them for specific use cases.

Offset Store

PropertyDefaultDescription
offset.storageNo defaultMust be set to io.debezium.storage.jdbc.offset.JdbcOffsetBackingStore.
offset.storage.jdbc.connection.urlNo defaultJDBC driver connection string to connect to the database.
offset.storage.jdbc.connection.userNo default(Optional) The username through which Debezium connects to the database that stores offset data.
offset.storage.jdbc.connection.passwordNo default(Optional) Password for the user specified by offset.storage.jdbc.connection.user.
offset.storage.jdbc.connection.wait.retry.delay.ms3 seconds(Optional) Specifies the time, in milliseconds, that the connector waits to retry the connection after failed attempts to connect to the offset storage database.
offset.storage.jdbc.connection.retry.max.attempts5(Optional) Specifies the maximum number of times that Debezium retries the connection to the offset storage database after a connection failure.
offset.storage.jdbc.table.namedebezium_offset_storageThe name of the table where Debezium stores offsets.
offset.storage.jdbc.table.ddlCreate QueryDDL statement to create the offset table.
offset.storage.jdbc.table.selectSelect queryDML statement that Debezium uses to read offsets values from the table.
offset.storage.jdbc.table.insertInsert queryDML statement that Debezium uses to write offsets to the table.
offset.storage.jdbc.table.deleteDelete queryDML statement that Debezium uses to remove offsets from the table.

Deprecated configuration prior to 3.2

PropertyDefaultDescription
offset.storageNo defaultMust be set to io.debezium.storage.jdbc.offset.JdbcOffsetBackingStore.
offset.storage.jdbc.urlNo defaultJDBC driver connection string to connect to the database.
offset.storage.jdbc.userNo default(Optional) The username through which Debezium connects to the database that stores offset data.
offset.storage.jdbc.passwordNo default(Optional) Password for the user specified by offset.storage.jdbc.user.
offset.storage.jdbc.wait.retry.delay.ms3 seconds(Optional) Specifies the time, in milliseconds, that the connector waits to retry the connection after failed attempts to connect to the offset storage database.
offset.storage.jdbc.retry.max.attempts5(Optional) Specifies the maximum number of times that Debezium retries the connection to the offset storage database after a connection failure.
offset.storage.jdbc.offset.table.namedebezium_offset_storageThe name of the table where Debezium stores offsets.
offset.storage.jdbc.offset.table.ddlCreate QueryDDL statement to create the offset table.
offset.storage.jdbc.offset.table.selectSelect queryDML statement to read offsets stored from the table.
offset.storage.offset.table.insertInsert queryDML statement to write offsets to the table.
offset.storage.jdbc.offset.table.deleteDelete queryDML statement to remove offsets from the table.

Offset Table defaults

Create Query

CREATE TABLE %s (
id VARCHAR(36)      NOT NULL,
offset_key          VARCHAR(1255),
offset_val          VARCHAR(1255),
record_insert_ts    TIMESTAMP NOT NULL,
record_insert_seq   INTEGER NOT NULL),
PRIMARY KEY (id)

Select query

SELECT id, offset_key, offset_val FROM %s ORDER BY record_insert_ts, record_insert_seq

Insert query

INSERT INTO %s(id, offset_key, offset_val, record_insert_ts, record_insert_seq)
    VALUES ( ?, ?, ?, ?, ? )

Delete query

DELETE FROM %s

Internal schema history store

PropertyDefaultDescription
schema.history.internalNo defaultMust be set to io.debezium.storage.jdbc.history.JdbcSchemaHistory.
schema.history.internal.jdbc.connection.urlNo defaultJDBC driver connection string to connect to the database.
schema.history.internal.jdbc.connection.userNo default(Optional) The username through which Debezium connects to the database that stores schema history data.
schema.history.internal.jdbc.connection.passwordNo default(Optional) Password for the user specified by schema.history.internal.jdbc.connection.user.
schema.history.internal.jdbc.connection.retry.delay.ms3 seconds(Optional) Specifies the time, in milliseconds, that the connector waits to retry the connection after an attempt to connect to the internal schema history database fails.
schema.history.internal.jdbc.connection.retry.max.attempts5(Optional) Specifies the maximum number of times that Debezium retries the connection to the internal schema history database after a connection failure.
schema.history.internal.jdbc.table.namedebezium_database_historyThe name of the table where Debezium stores the internal schema history.
schema.history.internal.jdbc.table.ddlCreate QueryThe DDL statement used to create a table to store the internal schema history.
schema.history.internal.jdbc.table.selectSelect queryThe SELECT statement to read schema changes from the internal schema history table.
schema.history.internal.jdbc.table.existsData Exist QueryThe SELECT statement that checks for the existence of an internal schema history storage table.
schema.history.internal.jdbc.table.insertInsert queryThe INSERT statement that records changes to the internal schema history table.

Deprecated configuration prior to 3.2

PropertyDefaultDescription
schema.history.internalNo defaultMust be set to io.debezium.storage.jdbc.history.JdbcSchemaHistory.
schema.history.internal.jdbc.urlNo defaultJDBC driver connection string to connect to the database.
schema.history.internal.jdbc.userNo default(Optional) The username through which Debezium connects to the database that stores internal schema history data.
schema.history.internal.jdbc.passwordNo default(Optional) Password for the user specified by schema.history.internal.jdbc.user.
schema.history.internal.jdbc.retry.delay.ms3 seconds(Optional) Specifies the time, in milliseconds, that the connector waits to retry the connection after an attempt to connect to the internal schema history database fails.
schema.history.internal.jdbc.retry.max.attempts5(Optional) Specifies the maximum number of times that Debezium retries the connection to the internal schema history database after a connection failure.
schema.history.internal.jdbc.schema.history.table.namedebezium_database_historyThe name of the table where Debezium stores the internal schema history.
schema.history.internal.jdbc.schema.history.table.ddlCreate QueryThe DDL statement used to create the internal schema history storage table.
schema.history.internal.jdbc.schema.history.table.selectSelect queryThe SELECT statement to read schema changes from the internal schema history table.
schema.history.internal.jdbc.schema.history.table.existsData Exist QueryThe SELECT statement that checks for the existence of an internal schema history storage table.
schema.history.internal.jdbc.schema.history.table.insertDelete queryThe INSERT statement that records changes to the internal schema history table.

History Table defaults

Create Query

CREATE TABLE %s (
    id VARCHAR(36) NOT NULL,
    history_data VARCHAR(65000),
    history_data_seq INTEGER,
    record_insert_ts TIMESTAMP NOT NULL,
    record_insert_seq INTEGER NOT NULL,
    PRIMARY KEY (id, history_data_seq)
)

Select Query

SELECT id, history_data FROM %s
    ORDER BY record_insert_ts, record_insert_seq, id, history_data_seq

Data exist Query

SELECT * FROM %s LIMIT 1

Insert Query

INSERT INTO %s(id, history_data, history_data_seq, record_insert_ts, record_insert_seq) VALUES ( ?, ?, ?, ?, ? )

Redis

Debezium can use a Jedis client to store data in a Redis cache.

Debezium can use either a single Redis instance or use Redis Cluster mode:

Single instance mode

Connects to a single Redis server instance.

Cluster mode

Connects to a Redis Cluster for high availability and horizontal scaling.

To enable Redis Cluster mode, set the redis.cluster.enabled property to true and provide comma-separated host:port addresses in the redis.address property.

Offset Store

PropertyDefaultDescription
offset.storageNo defaultMust be set to io.debezium.storage.redis.offset.RedisOffsetBackingStore
offset.storage.redis.keymetadataoffsetsThe Redis key that Debezium uses to store offsets.
offset.storage.redis.addressNo defaultThe URL through which Debezium connects to Redis to store offset data.
offset.storage.redis.userNo defaultThe user account through which Debezium connects to Redis to store offset data.
offset.storage.redis.passwordNo defaultThe password for the user account through which Debezium connects to Redis to store offset data.
offset.storage.redis.db.index0The database index (0—​15) that Debezium uses to access Redis to store offset data.
offset.storage.redis.ssl.enabledfalseSpecifies whether Debezium uses SSL when communicating with Redis to store offset data.
offset.storage.redis.ssl.hostname.verification.enabledfalseSpecifies whether Debezium has hostname verification enabled when communicating with Redis to store offset data.
offset.storage.redis.ssl.truststore.pathNo defaultThe path to the trust store file used for SSL/TLS connections to Redis for offset storage. If set, Redis connections will use this property over other configuration or system properties.
offset.storage.redis.ssl.truststore.passwordNo defaultThe password for the trust store file used for SSL/TLS connections to Redis for offset storage. If set, Redis connections will use this property over other configuration or system properties.
offset.storage.redis.ssl.truststore.typeJKSThe type of the trust store file used for SSL/TLS connections to Redis for offset storage. If set, Redis connections will use this property over other configuration or system properties.
offset.storage.redis.ssl.keystore.pathNo defaultThe path to the key store file used for SSL/TLS connections to Redis for offset storage. If set, Redis connections will use this property over other configuration or system properties.
offset.storage.redis.ssl.keystore.passwordNo defaultThe password for the key store file used for SSL/TLS connections to Redis for offset storage. If set, Redis connections will use this property over other configuration or system properties.
offset.storage.redis.ssl.keystore.typeJKSThe type of the key store file used for SSL/TLS connections to Redis for offset storage.
offset.storage.redis.connection.timeout.ms2000Specifies the time, in milliseconds, that Debezium waits to establish a connection to Redis before the connection times out.
offset.storage.redis.socket.timeout.ms2000Specifies the interval, in milliseconds, that Debezium allows for exchanging offset data with Redis before the socket times out. If a data packet is not transferred with the specified interval, Debezium closes the socket.
offset.storage.redis.retry.initial.delay.ms300Specifies the time, in milliseconds, that Debezium waits to retry the connection after an initial attempt to connect to Redis fails.
offset.storage.redis.retry.max.delay.ms10000Specifies the maximum time, in milliseconds, that Debezium waits to retry the connection after an attempt to connect to Redis fails.
offset.storage.redis.retry.max.attempts10Specifies the maximum number of times that Debezium retries the connection to Redis after connection attempts fail.
offset.storage.redis.wait.enabledfalseIn Redis environments that are configured to use a replica shard, specifies whether Debezium waits for Redis to verify that it wrote data to the replica.
offset.storage.redis.wait.timeout.ms1000Specifies a time, in milliseconds, that Debezium waits for confirmation that Redis wrote data to a replica shard before the request times out.
offset.storage.redis.wait.retry.enabledfalseSpecifies whether Debezium retries failed requests to confirm whether data is written to a replica shard.
offset.storage.redis.wait.retry.delay.ms1000Specifies the time, in milliseconds, that Debezium waits after a failure before it resubmits a request to Redis to confirm data is written to a replica shard.
offset.storage.redis.cluster.enabledfalseIf you configure Debezium Server to store offsets in Redis, set this property to specify whether to use Redis Cluster mode. Set the value to true to configure Debezium to use a JedisCluster client to route offset data to Redis nodes.

Internal schema history store

PropertyDefaultDescription
schema.history.internalNo defaultMust be set to io.debezium.storage.redis.history.RedisSchemaHistory
schema.history.internal.redis.keymetadataschema_historyThe Redis key that Debezium uses to store the schema history data.
schema.history.internal.redis.addressNo defaultThe URL through which Debezium connects to Redis to store schema history data.
schema.history.internal.redis.userNo defaultThe user account through which Debezium connects to Redis to store schema history data.
schema.history.internal.redis.passwordNo defaultThe password for the user account through which Debezium connects to Redis to store schema history data.
schema.history.internal.redis.db.index0The database index (0—​15) that Debezium uses to access Redis to store schema history data.
schema.history.internal.storage.redis.ssl.enabledfalseSpecifies whether Debezium uses SSL when communicating with Redis to store schema history data.
schema.history.internal.storage.redis.ssl.hostname.verification.enabledfalseSpecifies whether Debezium has hostname verification enabled when communicating with Redis to store schema history data.
schema.history.internal.storage.redis.ssl.truststore.pathNo defaultThe path to the trust store file used for SSL/TLS connections to Redis to store schema history data.
schema.history.internal.storage.redis.ssl.truststore.passwordNo defaultThe password for the trust store file used for SSL/TLS connections to Redis to store schema history data.
schema.history.internal.storage.redis.ssl.truststore.typeJKSThe type of the trust store file used for SSL/TLS connections to Redis to store schema history data.
schema.history.internal.storage.redis.ssl.keystore.pathNo defaultThe path to the key store file used for SSL/TLS connections to Redis to store schema history data.
schema.history.internal.storage.redis.ssl.keystore.passwordNo defaultThe password for the key store file used for SSL/TLS connections to Redis to store schema history data.
schema.history.internal.storage.redis.ssl.keystore.typeJKSThe type of the key store file used for SSL/TLS connections to Redis to store schema history data.
schema.history.internal.storage.redis.connection.timeout.ms2000Specifies the time, in milliseconds, that Debezium waits to establish a connection to Redis before the connection times out.
schema.history.internal.storage.redis.socket.timeout.ms2000Specifies the interval, in milliseconds, that Debezium allows for exchanging schema history data with Redis. If a data packet is not transferred with the specified interval, Debezium closes the socket.
schema.history.internal.storage.redis.retry.initial.delay.ms300Specifies the time, in milliseconds, that Debezium waits to retry the connection after an initial attempt to connect to Redis fails.
schema.history.internal.storage.redis.retry.max.delay.ms10000Specifies the maximum time, in milliseconds, that Debezium waits to retry the connection after an attempt to connect to Redis fails.
schema.history.internal.storage.redis.retry.max.attempts10Specifies the maximum number of times that Debezium retries the connection to Redis after connection attempts fail.
schema.history.internal.storage.redis.wait.enabledfalseIn Redis environments that are configured to use a replica shard, specifies whether Debezium waits for Redis to verify that it wrote data to the replica.
schema.history.internal.storage.redis.wait.timeout.ms1000Specifies the time, in milliseconds, that Debezium waits for confirmation that Redis wrote data to a replica shard before the request times out.
schema.history.internal.storage.redis.wait.retry.enabledfalseSpecifies whether Debezium retries failed requests to confirm whether data is written to a replica shard.
schema.history.internal.storage.redis.wait.retry.delay.ms1000Specifies the time, in milliseconds, that Debezium waits after a failure before it resubmits a request to Redis to confirm data is written to a replica shard.
schema.history.internal.storage.redis.cluster.enabledfalseIf you configure Debezium Server to store schema history in Redis, set this property to specify whether to use Redis Cluster mode. Set the value to true to configure Debezium to use a JedisCluster client to route history data to Redis nodes.

Redis Configuration Examples

Single Instance Mode

# Offset storage configuration
offset.storage=io.debezium.storage.redis.offset.RedisOffsetBackingStore
offset.storage.redis.address=localhost:6379
offset.storage.redis.password=password
offset.storage.redis.cluster.enabled=false

# Schema history storage configuration
schema.history.internal=io.debezium.storage.redis.history.RedisSchemaHistory
schema.history.internal.storage.redis.address=localhost:6379
schema.history.internal.storage.redis.password=password
schema.history.internal.storage.redis.cluster.enabled=false

Cluster Mode

# Offset storage configuration
offset.storage=io.debezium.storage.redis.offset.RedisOffsetBackingStore
offset.storage.redis.address=redis-node-1:7001,redis-node-2:7002,redis-node-3:7003
offset.storage.redis.password=password
offset.storage.redis.cluster.enabled=true

# Schema history storage configuration
schema.history.internal=io.debezium.storage.redis.history.RedisSchemaHistory
schema.history.internal.storage.redis.address=redis-node-1:7001,redis-node-2:7002,redis-node-3:7003
schema.history.internal.storage.redis.password=password
schema.history.internal.storage.redis.cluster.enabled=true
If you configure Debezium to use Redis Cluster mode, ensure that your Redis Cluster is properly configured and accessible. The Debezium Server instance must be able to communicate with the cluster nodes.

Amazon S3

Debezium can use the Amazon S3 object storage service. Typically, you would use S3 storage when you deploy Debezium with Amazon Managed Streaming for Apache Kafka (Amazon MSK).

Internal schema history store

Property Default Description

schema.history.internal

No default

Must be set to io.debezium.storage.s3.history.S3SchemaHistory.

schema.history.internal.s3.access.key.id

No default

(Optional) The identifier of the static access key that Debezium uses to authenticate with S3.

schema.history.internal.s3.secret.access.key

No default

(Optional) The Amazon Web Services (AWS) secret key that Debezium uses to authenticate to S3.

schema.history.internal.s3.region.name

No default

(Optional) Specifies the name of the region that hosts the S3 bucket.

schema.history.internal.s3.bucket.name

No default

Specifies the name of the S3 bucket that stores the schema history.

schema.history.internal.s3.object.name

No default

Specifies the object name in the bucket that stores the schema history.

schema.history.internal.s3.endpoint

No default

(Optional) Specifies a custom URL that Debezium uses to access the S3 service.
Provide the URL in the following format: http://<server>:<port>;

Azure Blob Storage

Debezium can use the Azure Blob storage service to store data. Typically, you would use Azure Blob storage when you deploy Debezium in the Apache Kafka in Azure HDInsight service.

Internal schema history store

PropertyDefaultDescription
schema.history.internalNo defaultMust be set to io.debezium.storage.azure.blob.history.AzureBlobSchemaHistory.
schema.history.internal.azure.storage.account.connectionstringNo defaultSpecifies the Azure Blob storage connection string.
schema.history.internal.azure.storage.account.nameNo defaultThe name of the account that Debezium uses to connect to Azure.
schema.history.internal.azure.storage.account.blob.endpointNo defaultAn optional Azure Blob Storage account endpoint URL. Use this to override the default public endpoint (https://<account>.blob.core.windows.net) for sovereign clouds such as Azure Government (https://<account>.blob.core.usgovcloudapi.net) or Azure China (https://<account>.blob.core.chinacloudapi.cn). Only used when schema.history.internal.azure.storage.account.connectionstring is not set. Should not be set together with schema.history.internal.azure.storage.account.name.
schema.history.internal.azure.storage.account.container.nameNo defaultThe name of the Azure container in which Debezium stores data.
schema.history.internal.azure.storage.blob.nameNo defaultThe name of the blob where Debezium stores data.

RocketMQ

Debezium can use the RocketMqSchemaHistory class to store and retrieve database schema changes in Apache RocketMQ.

Internal schema history store

PropertyDefaultDescription
schema.history.internalNo defaultMust be set to io.debezium.storage.rocketmq.history.RocketMqSchemaHistory.
schema.history.internal.rocketmq.topicNo DefaultThe name of the RocketMQ topic where Debezium stores the database schema history.
schema.history.internal.rocketmq.name.srv.addrNo DefaultSpecifies the host and port where the Apache RocketMQ NameServer discovery service is available.
schema.history.internal.rocketmq.acl.enabledfalseSpecifies whether to enable access control lists in RocketMQ.
schema.history.internal.rocketmq.access.keyNo DefaultSpecifies the RocketMQ access key. This field must include a value if schema.history.internal.rocketmq.acl.enabled is set to true.
schema.history.internal.rocketmq.secret.keyNo DefaultSpecifies the RocketMQ secret key. This field must include a value if schema.history.internal.rocketmq.acl.enabled is set to true.
schema.history.internal.rocketmq.recovery.attemptsNo DefaultSpecifies the number of consecutive attempts in which RocketMQ returns no data before recovery completes.
schema.history.internal.rocketmq.recovery.poll.interval.msNo DefaultSpecifies the time, in milliseconds, that Debezium waits after each poll attempt to recover the history.
schema.history.internal.rocketmq.store.record.timeout.msNo DefaultSpecifies the time, in milliseconds, that Debezium waits for a write to Rocket MQ to complete before the operation times out.

Chronicle Queue

Debezium connectors buffer change events in an internal queue before delivering them to the runtime framework. By default, Debezium uses an in-memory bounded queue. You can replace the default queue with a Chronicle Queue backed implementation by setting the queue.provider.type connector property. Chronicle Queue writes events to memory-mapped files on disk, reducing heap pressure during high-throughput periods.

Two Chronicle Queue implementations are available:

chronicle

Spills all change events to disk. This removes events from the JVM heap entirely, which is useful when you expect sustained high throughput and want to minimize garbage collection overhead.

hybrid_chronicle

Uses an in-memory queue as the primary buffer and spills overflow to disk when the buffer reaches its capacity. In low-traffic scenarios, no serialization or disk I/O occurs.

Chronicle Queue does not support operating off any network-based file system. This includes NFS, AFS, SAN-based storage, or similar. The reason for this is those systems do not provide all the required primitives for memory-mapped files. If any networking is needed to make the files accessible to the host(s), then Chronicle Queue cannot be used.

JVM setup

When using the debezium/server or debezium/connect container images, all the required JVM setups will be configured for you by setting the environment variable ENABLE_CHRONICLE_QUEUE to true.

When using other deployment alternatives, Chronicle Queue’s access to several internal JVM APIs must be explicitly provided by your configuration. This requires specifying the following JVM startup arguments, which grants Chronicle Queue reflective access to core Java internals required for its off-heap memory management and low-latency operations.

--add-opens=java.base/sun.nio.ch=ALL-UNNAMED
--add-opens=java.base/java.lang=ALL-UNNAMED
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED
--add-opens=java.base/java.io=ALL-UNNAMED
--add-opens=java.base/java.util=ALL-UNNAMED

Chronicle Queue provider

To use the chronicle provider, set queue.provider.type to chronicle.

PropertyDefaultDescription
queue.provider.typememoryMust be set to chronicle.
chronicle.queue.pathNo default(Optional) The directory path where Chronicle Queue stores its data files. If not set, Debezium creates a temporary directory that is cleaned up when the connector stops.

Hybrid Chronicle Queue provider

To use the hybrid_chronicle provider, set queue.provider.type to hybrid_chronicle.

The in-memory buffer holds the most recent events up to the capacity defined by max.queue.size. When the buffer reaches capacity, the oldest event is evicted to disk before a new event is added. When polling, Debezium drains evicted events from Chronicle Queue first, then from the in-memory buffer, preserving strict FIFO ordering.

PropertyDefaultDescription
queue.provider.typememoryMust be set to hybrid_chronicle.
chronicle.queue.pathNo default(Optional) The directory path where Chronicle Queue stores its data files. If not set, Debezium creates a temporary directory that is cleaned up when the connector stops.
The in-memory buffer capacity for the hybrid_chronicle provider is controlled by the connector’s existing max.queue.size property.

评论

登录后参与评论

正在加载评论…