MySQL CDC Source (Debezium) Connector for Confluent Cloud¶
Note
- MariaDB is not currently supported. See the Debezium docs for more information.
- If you are installing the connector locally for Confluent Platform, see Debezium MySQL Source connector for Confluent Platform.
The Kafka Connect MySQL Change Data Capture (CDC) Source (Debezium) connector for Confluent Cloud can obtain a snapshot of the existing data in a MySQL database and then monitor and record all subsequent row-level changes to that data. The connector supports Avro, JSON Schema, Protobuf, or JSON (schemaless) output data formats. All of the events for each table are recorded in a separate Apache Kafka® topic. The events can then be easily consumed by applications and services.
Features¶
The MySQL CDC Source (Debezium) connector provides the following features:
- Topics created automatically: The connector automatically creates Kafka topics using the naming convention:
<database.server.name>.<schemaName>.<tableName>
. The tables are created with the properties:topic.creation.default.partitions=1
andtopic.creation.default.replication.factor=3
. For more information, see Maximum message size. - Databases included and Databases excluded: Sets whether a database is or is not monitored for changes. By default, the connector monitors every database on the server.
- Tables included and Tables excluded: Sets whether a table is or is not monitored for changes.
- Output formats: The connector supports Avro, JSON Schema, Protobuf, or JSON (schemaless) output Kafka record value format. It supports Avro, JSON Schema, Protobuf, JSON (schemaless), and String output record key format. Schema Registry must be enabled to use a Schema Registry-based format (for example, Avro, JSON_SR (JSON Schema), or Protobuf). See Environment Limitations for additional information.
- Tasks per connector: Organizations can run multiple connectors with a limit of one task per connector (that is,
"tasks.max": "1"
). - Snapshot mode: Specifies the criteria for running a snapshot.
- Tombstones on delete: Sets whether a tombstone event is generated after a delete event. Default is
true
. - Database authentication: Uses password authentication.
- SSL support: Supports one-way SSL.
- Data formats: Supports Avro, JSON Schema, Protobuf, or JSON (schemaless) output data. Schema Registry must be enabled to use a Schema Registry-based format (for example, Avro, JSON_SR (JSON Schema), or Protobuf). See Environment Limitations for additional information.
Note
database.server.id
is set to a random number between 5400 and 6400.
For more information and examples to use with the Confluent Cloud API for Connect, see the Confluent Cloud API for Connect section.
Limitations¶
Be sure to review the following information.
- For connector limitations, see MySQL CDC Source Connector (Debezium) limitations.
- If you plan to use one or more Single Message Transforms (SMTs), see SMT Limitations.
- If you plan to use Confluent Cloud Schema Registry, see Environment Limitations.
Maximum message size¶
This connector creates topics automatically. When it creates topics, the internal connector configuration property max.message.size
is set to the following:
- Basic cluster:
2 MB
- Standard cluster:
2 MB
- Dedicated cluster:
20 MB
For more information about Confluent Cloud clusters, see Confluent Cloud Features and Limits by Cluster Type.
Quick Start¶
Use this quick start to get up and running with the MySQL CDC Source (Debezium) connector. The quick start provides the basics of selecting the connector and configuring it to obtain a snapshot of the existing data in a MySQL database and then monitoring and recording all subsequent row-level changes.
- Prerequisites
Authorized access to a Confluent Cloud cluster on Amazon Web Services (AWS), Microsoft Azure (Azure), or Google Cloud Platform (GCP).
The Confluent CLI installed and configured for the cluster. See Install the Confluent CLI.
Schema Registry must be enabled to use a Schema Registry-based format (for example, Avro, JSON_SR (JSON Schema), or Protobuf). See Environment Limitations for additional information.
Public access may be required for your database. See Network Access for details. The example below shows the AWS Management Console when setting up a MySQL database.
Public access enabled¶
For networking considerations, see Networking and DNS Considerations. To use static egress IPs, see Static Egress IP Addresses. The example below shows the AWS Management Console when setting up security group rules for the VPC.
Open inbound traffic¶
Note
See your specific cloud platform documentation for how to configure security rules for your VPC.
Kafka cluster credentials. The following lists the different ways you can provide credentials.
- Enter an existing service account resource ID.
- Create a Confluent Cloud service account for the connector. Make sure to review the ACL entries required in the service account documentation. Some connectors have specific ACL requirements.
- Create a Confluent Cloud API key and secret. To create a key and secret, you can use confluent api-key create or you can autogenerate the API key and secret directly in the Cloud Console when setting up the connector.
Update the following settings for the MySQL database.
Turn on backup for the database.
Create a new parameter group and set the following parameters:
binlog_format=ROW binlog_row_image=full
Apply the new parameter group to the database.
Reboot the database.
The following example screens are from Amazon RDS:
Using the Confluent Cloud Console¶
Step 1: Launch your Confluent Cloud cluster.¶
See the Quick Start for Apache Kafka using Confluent Cloud for installation instructions.
Step 2: Add a connector.¶
In the left navigation menu, click Data integration, and then click Connectors. If you already have connectors in your cluster, click + Add connector.
Step 4: Set up the connection.¶
Complete the following and click Continue.
Note
- Make sure you have all your prerequisites completed.
- An asterisk ( * ) designates a required entry.
Enter a connector name.
Select the way you want to provide Kafka Cluster credentials. You can either select a service account resource ID or you can enter an API key and secret (or generate these in the Cloud Console).
Add the database connection details.
Important
Do not include
jdbc:xxxx://
in the connection hostname property. The example below shows a sample host address.The default SSL mode is
preferred
. Whenpreferred
is enabled, the connector attempts to use an encrypted connection to the database server. The optionspreferred
andrequired
use a secure (encrypted) connection. The connector fails if a secure connection cannot be established. These modes do not do Certification Authority (CA) validation.Add optional Database details.
- Databases included: Enter a comma-separated list of fully-qualified database identifiers for the connector to monitor. By default, the connector monitors all databases on the server. A fully-qualified database name is in the form
<database-name>
. This can’t be used with Databases excluded. - Databases excluded: Enter a comma-separated list of fully-qualified database identifiers for the connector to ignore. By default, the connector monitors all databases on the server. A fully-qualified database name is in the form
<database-name>
. This can’t be used with Databases included. - Connection timezone: Enter a valid time zone ID for the database location and server connection. For more information, see ZoneID.
- Tables included: Enter a comma-separated list of fully-qualified table identifiers for the connector to monitor. By default, the connector monitors all non-system tables. A fully-qualified table name is in the form
schemaName.tableName
. This can’t be used with Tables excluded. - Propagate Source Types by Data Type: Enter a comma-separated list of regular expressions matching database-specific data types. The property adds the data type’s original type and original length (as parameters) to the corresponding field schemas in the emitted change records.
- Tables excluded: Enter a comma-separated list of fully-qualified table identifiers for the connector to ignore. A fully-qualified table name is in the form
schemaName.tableName
. This can’t be used Tables included. - Snapshot mode: Specifies the criteria for performing a database snapshot when the connector starts.
- The default option is
initial
. When selected, the connector takes a snapshot of the structure and data from captured tables. This is useful if you want the topics populated with a complete representation of captured table data when the connector starts. never
: Specifies that the connector should never perform snapshots, and that when starting for the first time, the connector starts reading from where it last left off.schema_only
: The connector completes a snapshot of the schemas and not the data. This option is useful when you do not need the topics to contain a consistent snapshot of the data, but need them to have only the changes since the connector was started.schema_only_recovery
: A recovery option for a connector that has already been capturing changes. When you restart the connector, it recovers a corrupted or lost database history topic. You might use this option periodically to clean up a database history topic that has been growing unexpectedly. Database history topics require infinite retention.when_needed
specifies that the connector performs a snapshot when it considers a snapshot is needed.
- The default option is
- Snapshot locking mode: Controls how long the connector holds a global read lock as it performs a snapshot. The default is
minimal
, which means the connector holds the global read lock (preventing any updates) for just the initial portion of the snapshot, while the database schemas and other metadata are being read. The remaining work in a snapshot involves selecting all rows from each table. This is accomplished using aREPEATABLE READ
transaction, even when the read lock is off and other operations are updating the database. (Useminimal_percona
for a Percona server.) In some cases it may be desirable to block all writes for the entire duration of the snapshot. In a case like this, set this property toextended
. The optionnone
prevents the connector from acquiring any table locks during the snapshot. While this setting is allowed with all snapshot modes, it is safe to use only if no schema changes are happening while the snapshot is running. Note that for tables defined with the MyISAM engine, the tables are locked regardless of this property’s setting, since MyISAM acquires a table lock. This behavior is unlike the InnoDB engine, which acquires row level locks. - Tombstones on delete: Configure whether a tombstone event should be generated after a delete event. The default is
true
. - Columns Excluded: An optional, comma-separated list of regular expressions that match the fully-qualified names of columns to exclude from change event record values. Fully-qualified names for columns are in the form
databaseName.tableName.columnName
.
- Databases included: Enter a comma-separated list of fully-qualified database identifiers for the connector to monitor. By default, the connector monitors all databases on the server. A fully-qualified database name is in the form
Add optional Connection details.
- Poll interval (ms): Enter the number of milliseconds (ms) the connector should wait during each iteration for new change events to appear. Defaults to
1000
ms (1 second). - Max batch size: Enter the maximum number of events the connector batches during each iteration. Defaults to
1000
events. - Event processing failure handling mode: Specify how the connector reacts to exceptions when processing binlog events. Defaults to
fail
. Selectskip
orwarn
to skip the event or issue a warning, respectively. - Heartbeat interval (ms): Set the interval time in milliseconds (ms) between heartbeat messages that the connector sends to a Kafka topic. Defaults to
0
, which means the connector does not send heartbeat messages. - Skip unparseable DDL: Set this to
true
to have the connector ignore malformed or unknown database statements. Set tofalse
to stop processing so these issues can be corrected. Defaults tofalse
. Consider setting this totrue
to ignore unparseable statements. - Event deserialization failure handling mode: Specify how the connector reacts to exceptions when deserializing binlog events. Defaults to
fail
. Selectskip
orwarn
to skip the event or issue a warning, respectively. - Inconsistent schema handling mode: Specify how the connector reacts to binlog events that belong to a table missing from the internal schema representation. Defaults to
fail
. Selectskip
orwarn
to skip the event or issue a warning, respectively.
- Poll interval (ms): Enter the number of milliseconds (ms) the connector should wait during each iteration for new change events to appear. Defaults to
Add optional Connector details:
- Provide transaction metadata: Select whether transaction metadata is enabled. Transaction metadata is stored in a dedicated Kafka topic. Defaults to
false
. - Decimal handling mode: Specify how
DECIMAL
andNUMERIC
columns are represented in change events.precise
(the default) uses java.math.BigDecimal to represent values. The values are encoded in change events using a binary representation and the Connect org.apache.kafka.connect.data.Decimal data type. Selectstring
to use string type to represent values.double
represents values using Java’sdouble
data type.double
does not provide precision, but is much easier to use in consumers. - Binary handling mode: Specify how binary (blob, binary) columns are represented in change events. Select
bytes
(the default) to represent binary data in byte array format. Selectbase64
to represent binary data in base64-encoded string format. Selecthex
to represent binary data in hex-encoded (base16) string format. - Time precision mode: Time, date, and timestamps can be represented with different kinds of precision.
adaptive_time_microseconds
is similar to adaptive precision with allTIME
fields using microseconds precision.connect
(the default) always represents time, date, and timestamp values using Connect’s built-in representations for Time, Date, and Timestamp.connect
uses millisecond precision regardless of what precision is used for the database columns. For more information, see Temporal types. - Topic cleanup policy: Set the topic retention cleanup policy. Select
delete
(the default) to discard old topics. Selectcompact
to enable log compaction on the topic. - Bigint Unsigned handling mode: Specify how unsigned
BIGINT
columns are represented in change events. The options are the data typelong
(the default) andprecise
.precise
uses java.math.BigDecimal to represent values. The values are encoded in change events using a binary representation and the Connect org.apache.kafka.connect.data.Decimal data type. - Enable time adjuster: Specify whether the year value conversion is adjusted by the connector (
true
) or delegated to the database (false
). Defaults totrue
.
- Provide transaction metadata: Select whether transaction metadata is enabled. Transaction metadata is stored in a dedicated Kafka topic. Defaults to
Select values for the following Output properties:
Output Kafka record value format: (coming from the connector): AVRO, JSON (schemaless), JSON_SR (JSON Schema), or PROTOBUF. A valid schema must be available in Schema Registry to use a schema-based record format (for example, Avro, JSON_SR (JSON Schema), or Protobuf).
After-state only: (Optional) Defaults to true, which results in the Kafka record having only the record state from change events applied. Select false to maintain the prior record states after applying the change events.
Output Kafka record key format (coming from the connector): AVRO, JSON (schemaless), JSON_SR (JSON Schema), PROTOBUF, or String. A valid schema must be available in Schema Registry to use a schema-based record format (for example, Avro, JSON_SR (JSON Schema), or Protobuf).
JSON output decimal format: (Optional) Defaults to BASE64.
Enter the number of tasks in use by the connector. Organizations can run multiple connectors with a limit of one task per connector (that is,
"tasks.max": "1"
).Transforms and Predicates: See the Single Message Transforms (SMT) documentation for details.
See:ref:cc_mysql-cdc-source-config-properties for all properties and definitions.
Step 5: Launch the connector.¶
Verify the connection details and click Launch.
Step 6: Check the connector status.¶
The status for the connector should go from Provisioning to Running. It may take a few minutes.
Step 7: Check the Kafka topic.¶
After the connector is running, verify that messages are populating your Kafka topic.
Note
A topic named dbhistory.<database.server.name>.<connect-id>
is
automatically created for database.history.kafka.topic
with one partition.
For more information and examples to use with the Confluent Cloud API for Connect, see the Confluent Cloud API for Connect section.
See also
For an example that shows fully-managed Confluent Cloud connectors in action with Confluent Cloud ksqlDB, see the Cloud ETL Demo. This example also shows how to use Confluent CLI to manage your resources in Confluent Cloud.
Using the Confluent CLI¶
Complete the following steps to set up and run the connector using the Confluent CLI.
Note
- Make sure you have all your prerequisites completed.
- The example commands use Confluent CLI version 2. For more information see, Confluent CLI v2.
Step 1: List the available connectors.¶
Enter the following command to list available connectors:
confluent connect plugin list
Step 2: Show the required connector configuration properties.¶
Enter the following command to show the required connector properties:
confluent connect plugin describe <connector-catalog-name>
For example:
confluent connect plugin describe MySqlCdcSource
Example output:
Following are the required configs:
connector.class: MySqlCdcSource
name
kafka.auth.mode
kafka.api.key
kafka.api.secret
database.hostname
database.user
database.server.name
output.data.format
tasks.max
Step 3: Create the connector configuration file.¶
Create a JSON file that contains the connector configuration properties. The following example shows the required connector properties.
{
"connector.class": "MySqlCdcSource",
"name": "MySqlCdcSourceConnector_0",
"kafka.auth.mode": "KAFKA_API_KEY",
"kafka.api.key": "****************",
"kafka.api.secret": "****************************************************************",
"database.hostname": "database-2.<host-ID>.us-west-2.rds.amazonaws.com",
"database.port": "3306",
"database.user": "admin",
"database.password": "**********",
"database.server.name": "mysql",
"database.whitelist": "employee",
"table.includelist":"employees.departments,
"snapshot.mode": "initial",
"output.data.format": "AVRO",
"tasks.max": "1"
}
Note the following property definitions:
"connector.class"
: Identifies the connector plugin name."name"
: Sets a name for your new connector.
"kafka.auth.mode"
: Identifies the connector authentication mode you want to use. There are two options:SERVICE_ACCOUNT
orKAFKA_API_KEY
(the default). To use an API key and secret, specify the configuration propertieskafka.api.key
andkafka.api.secret
, as shown in the example configuration (above). To use a service account, specify the Resource ID in the propertykafka.service.account.id=<service-account-resource-ID>
. To list the available service account resource IDs, use the following command:confluent iam service-account list
For example:
confluent iam service-account list Id | Resource ID | Name | Description +---------+-------------+-------------------+------------------- 123456 | sa-l1r23m | sa-1 | Service account 1 789101 | sa-l4d56p | sa-2 | Service account 2
"database.ssl.mode"
: The default optionprefer
is enabled ifdatabase.ssl.mode
is not added to the connector configuration. Whenprefer
is enabled, the connector attempts to use an encrypted connection to the database server. The optionsprefer
andrequire
use a secure (encrypted) connection. The connector fails if a secure connection cannot be established. These modes do not do Certification Authority (CA) validation."table.includelist"
: (Optional) Enter a comma-separated list of fully-qualified table identifiers for the connector to monitor. By default, the connector monitors all non-system tables. A fully-qualified table name is in the formschemaName.tableName
."column.exclude.list"
: (Optional) A comma-separated list of regular expressions that match the fully-qualified names of columns to exclude from change event record values. Fully-qualified names for columns are in the formdatabaseName.tableName.columnName
."snapshot.mode"
: (Optional) Specifies the criteria for performing a database snapshot when the connector starts.- The default option is
initial
. When selected, the connector takes a snapshot of the structure and data from captured tables. This is useful if you want the topics populated with a complete representation of captured table data when the connector starts. never
: Specifies that the connector should never perform snapshots, and that when starting for the first time, the connector starts reading from where it last left off.when_needed
: Specifies that the connector performs a snapshot when it considers a snapshot is needed.schema_only
: Specifies that the connector completes a snapshot of the schemas and not the data. This option is useful when you do not need the topics to contain a consistent snapshot of the data, but need them to have only the changes since the connector was started.schema_only_recovery
: A recovery option for a connector that has already been capturing changes. When you restart the connector, it recovers a corrupted or lost database history topic. You might use this option periodically to clean up a database history topic that has been growing unexpectedly.
- The default option is
"snapshot.locking.mode"
: (Optional) Controls how long the connector holds a global read lock as it performs a snapshot. The default isminimal
, which means the connector holds the global read lock (preventing any updates) for just the initial portion of the snapshot, while the database schemas and other metadata are being read. The remaining work in a snapshot involves selecting all rows from each table. This is accomplished using aREPEATABLE READ
transaction, even when the read lock is off and other operations are updating the database. (Useminimal_percona
for a Percona server.) In some cases it may be desirable to block all writes for the entire duration of the snapshot. In a case like this, set this property toextended
. The optionnone
prevents the connector from acquiring any table locks during the snapshot. While this setting is allowed with all snapshot modes, it is safe to use only if no schema changes are happening while the snapshot is running. Note that for tables defined with the MyISAM engine, the tables are locked regardless of this property’s setting, since MyISAM acquires a table lock. This behavior is unlike the InnoDB engine, which acquires row level locks."output.data.format"
: Sets the output Kafka record value format (data coming from the connector). Valid entries are AVRO, JSON_SR, PROTOBUF, or JSON. You must have Confluent Cloud Schema Registry configured if using a schema-based record format (for example, Avro, JSON_SR (JSON Schema), or Protobuf)."after.state.only"
: (Optional) Defaults to true, which results in the Kafka record having only the record state from change events applied. Enter false to maintain the prior record states after applying the change events."json.output.decimal.format"
: (Optional) Defaults to BASE64. Specify the JSON/JSON_SR serialization format for Connect DECIMAL logical type values with two allowed literals:- BASE64 to serialize DECIMAL logical types as base64 encoded binary data.
- NUMERIC to serialize Connect DECIMAL logical type values in JSON or JSON_SR as a number representing the decimal value.
"tasks.max"
: Enter the number of tasks in use by the connector. Organizations can run multiple connectors with a limit of one task per connector (that is,"tasks.max": "1"
).
Single Message Transforms: See the Single Message Transforms (SMT) documentation for details about adding SMTs using the CLI.
See:ref:cc_mysql-cdc-source-config-properties for all properties and definitions.
Step 4: Load the properties file and create the connector.¶
Enter the following command to load the configuration and start the connector:
confluent connect create --config <file-name>.json
For example:
confluent connect create --config mysql-cdc-source.json
Example output:
Created connector MySqlCdcSourceConnector_0 lcc-ix4dl
Step 5: Check the connector status.¶
Enter the following command to check the connector status:
confluent connect list
Example output:
ID | Name | Status | Type
+-----------+-----------------------------+---------+-------+
lcc-ix4dl | MySqlCdcSourceConnector_0 | RUNNING | source
Step 6: Check the Kafka topic.¶
After the connector is running, verify that messages are populating your Kafka topic.
Note
A topic named dbhistory.<database.server.name>.<connect-id>
is
automatically created for database.history.kafka.topic
with one partition.
For more information and examples to use with the Confluent Cloud API for Connect, see the Confluent Cloud API for Connect section.
Configuration Properties¶
Use the following configuration properties with this connector.
How should we connect to your data?¶
name
Sets a name for your connector.
- Type: string
- Valid Values: A string at most 64 characters long
- Importance: high
Kafka Cluster credentials¶
kafka.auth.mode
Kafka Authentication mode. It can be one of KAFKA_API_KEY or SERVICE_ACCOUNT. It defaults to KAFKA_API_KEY mode.
- Type: string
- Default: KAFKA_API_KEY
- Valid Values: KAFKA_API_KEY, SERVICE_ACCOUNT
- Importance: high
kafka.api.key
- Type: password
- Importance: high
kafka.service.account.id
The Service Account that will be used to generate the API keys to communicate with Kafka Cluster.
- Type: string
- Importance: high
kafka.api.secret
- Type: password
- Importance: high
How should we connect to your database?¶
database.hostname
The address of the MySQL server.
- Type: string
- Importance: high
database.port
Port number of the MySQL server.
- Type: int
- Valid Values: [0,…,65535]
- Importance: high
database.user
The name of the MySQL server user that has the required authorization.
- Type: string
- Importance: high
database.password
The password for the MySQL server user that has the required authorization.
- Type: password
- Importance: high
database.server.name
The logical name of the MySQL server cluster. This logical name forms a namespace and is used in all Kafka topic names and Kafka Connect schema names. The logical name is also used for the namespaces of the corresponding Avro schema, if Avro data format is used. Kafka topics must (and will be) created with the prefix
database.server.name
. Only alphanumeric characters, underscores, hyphens and dots are allowed.- Type: string
- Importance: high
database.ssl.mode
What SSL mode should we use to connect to your database. The default preferred option establishes an encrypted connection if the server supports secure connections. If the server does not support secure connections, it falls back to an unencrypted connection. The required option establishes an encrypted connection or fails if one cannot be made for any reason.
- Type: string
- Default: preferred
- Importance: low
Database details¶
database.include.list
An optional comma-separated list of strings that match database names to be monitored. Any database name not included in the list is excluded from monitoring. By default all databases are monitored. May not be used with database.exclude.list.
- Type: list
- Importance: medium
database.exclude.list
An optional comma-separated list of strings that match database names to be excluded from monitoring. Any database name not included in the list is monitored. May not be used with database.include.list.
- Type: list
- Importance: medium
table.include.list
An optional comma-separated list of strings that match fully-qualified table identifiers for tables to be monitored. Any table not included in this config property is excluded from monitoring. Each identifier is in the form
schemaName.tableName
. By default the connector monitors every non-system table in each monitored schema. May not be used with “Table excluded”.- Type: list
- Importance: medium
database.connectionTimeZone
The value must be a valid ZoneId.
- Type: string
- Importance: low
table.exclude.list
An optional comma-separated list of strings that match fully-qualified table identifiers for tables to be excluded from monitoring. Any table not included in this config property is monitored. Each identifier is in the form
schemaName.tableName
. May not be used with “Table included”.- Type: list
- Importance: medium
datatype.propagate.source.type
A comma-separated list of regular expressions matching the database-specific data type names that adds the data type’s original type and original length as parameters to the corresponding field schemas in the emitted change records.
- Type: list
- Importance: low
snapshot.mode
Specifies the criteria for running a snapshot when the connector starts. The default setting is initial and specifies that the connector can run a snapshot only when no offsets have been recorded for the logical server name. The when_needed option specifies that the connector run a snapshot upon startup whenever necessary; typically when no offsets are available, or when a previously recorded offset specifies a binlog location or GTID that is not available in the server. The never option specifies that the connect should never use snapshots and that when the connector starts with a logical server name, the connector should read from the beginning of the binlog. Use the never option with care, as it is only valid when the binlog is guaranteed to contain the entire history of the database. The schema_only option performs a snapshot of the schemas and not the data. This setting is useful when you do not need the topics to contain a consistent snapshot of the data but need them to have only the changes since the connector was started. The schema_only_recovery option is a recovery setting for a connector that has already been capturing changes. When you restart the connector, this setting enables recovery of a corrupted or lost database history topic. You might set it periodically to “clean up” a database history topic that has been growing unexpectedly. Database history topics require infinite retention.
- Type: string
- Default: initial
- Valid Values: initial, never, schema_only, schema_only_recovery, when_needed
- Importance: low
snapshot.locking.mode
Controls how long the connector holds onto the global read lock while it is performing a snapshot. The default is minimal, which means the connector holds the global read lock (and thus prevents any updates) for just the initial portion of the snapshot, while the database schemas and other metadata are being read. The remaining work in a snapshot involves selecting all rows from each table. This is accomplished using a REPEATABLE READ transaction, even when the lock is no longer held and other operations are updating the database. However, in some cases it may be desirable to block all writes for the entire duration of the snapshot. In this situation, set this property to extended. Using a value of none prevents the connector from acquiring any table locks during the snapshot process. While this setting is allowed with all snapshot modes, it is safe to use if and only if no schema changes are happening while the snapshot is running.
- Type: string
- Default: minimal
- Valid Values: extended, minimal, minimal_percona, none
- Importance: low
tombstones.on.delete
Controls whether a tombstone event should be generated after a delete event. When set to
true
, the delete operations are represented by a delete event and a subsequent tombstone event. When set tofalse
, only a delete event is sent. Emitting the tombstone event (the default behavior) allows Kafka to completely delete all events pertaining to the given key, once the source record got deleted.- Type: boolean
- Default: true
- Importance: high
column.exclude.list
Regular expressions matching columns to exclude from change events
- Type: list
- Importance: medium
Connection details¶
poll.interval.ms
Positive integer value that specifies the number of milliseconds the connector should wait during each iteration for new change events to appear. Defaults to 1000 milliseconds, or 1 second.
- Type: int
- Default: 1000 (1 second)
- Valid Values: [1,…]
- Importance: low
max.batch.size
Positive integer value that specifies the maximum size of each batch of events that should be processed during each iteration of this connector.
- Type: int
- Default: 1000
- Valid Values: [1,…,5000]
- Importance: low
event.processing.failure.handling.mode
Specifies how the connector should react to exceptions during processing of binlog events.
- Type: string
- Default: fail
- Valid Values: fail, skip, warn
- Importance: low
heartbeat.interval.ms
Controls how frequently the connector sends heartbeat messages to a Kafka topic. The behavior of default value 0 is that the connector does not send heartbeat messages.
- Type: int
- Default: 0
- Valid Values: [0,…]
- Importance: low
database.history.skip.unparseable.ddl
A Boolean value that specifies whether the connector should ignore malformed or unknown database statements (true), or stop processing so a human can fix the issue (false). Defaults to false. Consider setting this to true to ignore unparseable statements.
- Type: boolean
- Default: false
- Importance: low
event.deserialization.failure.handling.mode
Specifies how the connector should react to exceptions during deserialization of binlog events.
- Type: string
- Default: fail
- Valid Values: fail, skip, warn
- Importance: medium
inconsistent.schema.handling.mode
Specifies how the connector should react to binlog events that belong to a table missing from internal schema representation.
- Type: string
- Default: fail
- Valid Values: fail, skip, warn
- Importance: medium
Connector details¶
provide.transaction.metadata
Stores transaction metadata information in a dedicated topic and enables the transaction metadata extraction together with event counting.
- Type: boolean
- Default: false
- Importance: low
decimal.handling.mode
Specifies how DECIMAL and NUMERIC columns should be represented in change events, including: ‘precise’ (the default) uses java.math.BigDecimal to represent values, which are encoded in the change events using a binary representation and Kafka Connect’s ‘org.apache.kafka.connect.data.Decimal’ type; ‘string’ uses string to represent values; ‘double’ represents values using Java’s ‘double’, which may not offer the precision but will be far easier to use in consumers.
- Type: string
- Default: precise
- Valid Values: double, precise, string
- Importance: medium
binary.handling.mode
Specifies how binary (blob, binary, etc.) columns should be represented in change events, including: ‘bytes’ (the default) represents binary data as byte array; ‘base64’ represents binary data as base64-encoded string; ‘hex’ represents binary data as hex-encoded (base16) string.
- Type: string
- Default: bytes
- Valid Values: base64, bytes, hex
- Importance: low
time.precision.mode
Time, date, and timestamps can be represented with different kinds of precisions, including: ‘adaptive_time_microseconds’ TIME fields always use microseconds precision; ‘connect’ (the default) always represents time, date, and timestamp values using Kafka Connect’s built-in representations for Time, Date, and Timestamp, which uses millisecond precision regardless of the database columns’ precision.
- Type: string
- Default: connect
- Valid Values: adaptive_time_microseconds, connect
- Importance: medium
cleanup.policy
Set the topic cleanup policy
- Type: string
- Default: delete
- Valid Values: compact, delete
- Importance: medium
bigint.unsigned.handling.mode
Specifies how BIGINT UNSIGNED columns should be represented in change events.
- Type: string
- Default: long
- Valid Values: long, precise
- Importance: medium
enable.time.adjuster
Specifies if the year value conversion is adjusted by the connector or delegated to the database.
- Type: boolean
- Default: true
- Importance: medium
Output messages¶
output.data.format
Sets the output Kafka record value format. Valid entries are AVRO, JSON_SR, PROTOBUF, or JSON. Note that you need to have Confluent Cloud Schema Registry configured if using a schema-based message format like AVRO, JSON_SR, and PROTOBUF.
- Type: string
- Importance: high
output.key.format
Sets the output Kafka record key format. Valid entries are AVRO, JSON_SR, PROTOBUF, STRING or JSON. Note that you need to have Confluent Cloud Schema Registry configured if using a schema-based message format like AVRO, JSON_SR, and PROTOBUF
- Type: string
- Default: JSON
- Valid Values: AVRO, JSON, JSON_SR, PROTOBUF, STRING
- Importance: high
after.state.only
Controls whether the generated Kafka record should contain only the state after applying change events.
- Type: boolean
- Default: true
- Importance: low
json.output.decimal.format
Specify the JSON/JSON_SR serialization format for Connect DECIMAL logical type values with two allowed literals:
BASE64 to serialize DECIMAL logical types as base64 encoded binary data and
NUMERIC to serialize Connect DECIMAL logical type values in JSON/JSON_SR as a number representing the decimal value.
- Type: string
- Default: BASE64
- Importance: low
Number of tasks for this connector¶
tasks.max
- Type: int
- Valid Values: [1,…,1]
- Importance: high
Next Steps¶
See also
For an example that shows fully-managed Confluent Cloud connectors in action with Confluent Cloud ksqlDB, see the Cloud ETL Demo. This example also shows how to use Confluent CLI to manage your resources in Confluent Cloud.