DataStax Sink Connector for Confluent Cloud
The fully managed DataStax Sink connector for Confluent Cloud streams records from Apache Kafka® topics into Apache Cassandra, DataStax Enterprise (DSE), or DataStax Astra DB tables, without managing any connector infrastructure.
If you require private networking for fully managed connectors, make sure to set up the proper networking beforehand. For more information, see Manage Networking for Confluent Cloud Connectors.
Features
The DataStax Sink connector offers the following features:
Multiple targets: Writes to Apache Cassandra 2.1 and later, DSE 4.7 and later, or DataStax Astra DB, using the same connector configuration.
Multiple input formats: Supports AVRO, JSON_SR (JSON Schema), PROTOBUF, JSON (schemaless), or BYTES input data formats. Schema Registry must be enabled to use a Schema Registry-based format such as AVRO, JSON_SR, or PROTOBUF.
Declarative topic-to-table mapping: Maps record fields to table columns using the connector’s mapping domain-specific language (DSL), including fan-out from a single topic to multiple tables and consuming from multiple topics in one connector.
Row-level TTL and writetime overrides: Sets a row’s time-to-live (TTL) and write timestamp from values in the Kafka record, so data ages out and orders correctly without a separate cleanup job.
Automatic table management: Creates keyspaces and tables, adds columns when records gain new fields, and writes each topic to a table of the same name. See Automatic table management.
Flexible security and networking: Connects using TLS, PLAIN, or mutual TLS (mTLS) authentication, and supports private networking options where available on your cluster.
For more information and examples to use with the Confluent Cloud API for Connect, see the Confluent Cloud API for Connect Usage Examples section.
Limitations
For connector limitations, see DataStax Sink Connector.
If you plan to use one or more Single Message Transformations (SMTs), see SMT Limitations.
If you plan to use one or more Custom SMTs, see Custom SMT limitations.
Quick start
Select the connector and configure it to stream Kafka events into Cassandra, DSE, or Astra DB tables.
Prerequisites
Authorized access to a Confluent Cloud cluster on Amazon Web Services (AWS), Microsoft Azure (Azure), or Google Cloud.
The Confluent CLI installed and configured for the cluster. For more information, see Install the Confluent CLI.
Schema Registry must be enabled to use a Schema Registry-based format, such as AVRO, JSON_SR (JSON Schema), or PROTOBUF. For more information, see Limits for Fully Managed Connectors for Confluent Cloud.
Access to an Apache Cassandra, DSE, or DataStax Astra DB target. Unless you turn on automatic table management, the destination keyspace and tables must already exist. The connector does not create user-defined types (UDTs). If your records contain nested records (structs), create the UDT and its column yourself.
Database credentials with write access to the target keyspace. If you turn on Auto create table or Auto evolve table, the user also needs permission to create and alter tables in the keyspace. For Astra DB, a Secure Connect Bundle (SCB) downloaded from the Astra console.
For networking considerations, see Networking and DNS. To use a set of public egress IP addresses, see Public Egress IP Addresses for Confluent Cloud Connectors.
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.
Using the Confluent Cloud Console
Step 1: Launch your Confluent Cloud cluster
To create and launch a Kafka cluster in Confluent Cloud, see Create a kafka cluster in Confluent Cloud.
Step 2: Add a connector
In the left navigation menu, click Connectors. If you already have connectors in your cluster, click + Add connector.
Step 3: Select your connector
Click the DataStax Sink connector card.
Step 4: Enter the connector details
Before configuring the connector settings, ensure that you complete all prerequisites.
Note
An asterisk ( * ) designates a required entry.
At the Add DataStax Sink Connector screen, complete the following:
If you’ve already populated your Kafka topics, select the topics you want to connect from the Topics list.
To create a new topic, click +Add new topic.
Select the way you want to provide Kafka Cluster credentials. You can choose one of the following options:
My account: This setting allows your connector to globally access everything that you have access to. With a user account, the connector uses an API key and secret to access the Kafka cluster. This option is not recommended for production.
Service account: This setting limits the access for your connector by using a service account. This option is recommended for production.
Use an existing API key: This setting allows you to specify an API key and a secret pair. You can use an existing pair or create a new one. This method is not recommended for production environments.
Note
Freight clusters support only service accounts for Kafka authentication.
Click Continue.
Choose the Deployment type, either
Apache Cassandra or DSEorDataStax Astra, and configure the matching connection and authentication properties:How should we connect to Cassandra / DSE / Astra?
Deployment type: The database you are connecting to. Choose
Apache Cassandra or DSEto connect through contact points (optionally with SSL/TLS), orDataStax Astrato connect through an uploaded Secure Connect Bundle. The two modes are mutually exclusive and the connector cannot use both at once. For CLI or Terraform provisioning, set this explicitly.Cassandra/DSE contact points: Comma-separated host names or IPs of the Cassandra or DSE cluster contact points. Used only for the
Apache Cassandra or DSEdeployment type. Leave this empty for Astra and use the Secure Connect Bundle instead.Native transport port: Cassandra/DSE native transport port (ignored for Astra).
Local datacenter: Name of the local datacenter the driver should treat as local (commonly
dc1). Required for theApache Cassandra or DSEdeployment type. Must not be set for Astra.Astra Secure Connect Bundle: DataStax Astra DB Secure Connect Bundle (SCB). Required for the
DataStax Astradeployment type, and mutually exclusive with contact points, local datacenter, or SSL settings. Upload the SCB zip file. For REST API usage base64-encode it and prefix withdata:application/octet-stream;base64,.
Authentication
Authentication provider: Authentication provider to the database.
Nonefor no authentication,PLAINfor username/password (also used for LDAP and for Astra token authentication).Username: Database username for
PLAINauthentication. For Astra token authentication use the literaltoken.Password: Database password for
PLAINauthentication. For Astra token authentication use theAstraCS:...token.
Security (SSL/TLS)
SSL/TLS provider: SSL/TLS engine used for the connection to Cassandra/DSE.
Nonedisables SSL.JDKuses the JSSE keystore/truststore (JKS). Only applicable to theApache Cassandra or DSEdeployment type — Astra’s TLS material is carried inside the Secure Connect Bundle.Validate server hostname: Whether to validate the database node hostnames against the certificate when SSL is enabled.
Truststore file: Truststore file (JKS) containing the CA certificate(s) that sign the database server certificates. Upload the file. For REST API usage base64-encode it and prefix with
data:application/octet-stream;base64,.Truststore password: Password protecting the truststore file. Leave empty if the truststore has no password.
Keystore file (mTLS): Keystore file (JKS) holding the client certificate and private key for mutual TLS (client authentication). Only needed when the database requires client certificates. Upload the file. For REST API usage base64-encode it and prefix with
data:application/octet-stream;base64,.Keystore password: Password protecting the keystore file (leave empty if the keystore has no password).
Cipher suites: Optional comma-separated list of TLS cipher suites to enable. Leave empty to use the JVM defaults.
Click Continue.
Note
Configuration properties that are not shown in the Cloud Console use the default values. For all property values and definitions, see Configuration Properties.
Input Kafka record value format: Sets the input Kafka record value format. Valid entries are AVRO, JSON_SR, PROTOBUF, JSON, or BYTES. Note that you need to have Confluent Cloud Schema Registry configured if using a schema-based message format like AVRO, JSON_SR, and PROTOBUF.
Table mapping
Mapping mode: Sets how the connector maps records to tables.
EXPLICIT(default) uses the topic-to-table field mapping to map each topic to its tables and each field to a column.IMPLICITwrites each topic to the table of the same name in the Keyspace name keyspace, and each key and value field to the column of the same name. The connector lower-cases names, such asuserIdtouserid, so topic names can use only letters, digits, and underscores, up to 48 characters.IMPLICITmode needs AVRO, JSON_SR, or PROTOBUF data. The table must already exist unless you turn on Auto create table.Keyspace name: Sets the keyspace for the tables in
IMPLICITmode. You must set it in that mode. InEXPLICITmode, each entry in the topic-to-table field mapping sets the keyspace instead. The connector lower-cases the name unless you wrap it in double quotes, for example"MyKeyspace".Topic-to-table field mapping: JSON object mapping each
<topic>.<keyspace>.<table>to its field-to-column mapping, for example{"orders.ecom.orders":"id=value.id, amount=value.amount"}. Usekey.*to reference record-key fields (primary-key columns) andvalue.*for record-value fields. Each entry materializes to the engine keytopic.<topic>.<keyspace>.<table>.mapping. A single topic can map to multiple tables (fan-out) by adding multiple entries.Auto create keyspace: Creates the keyspace if it does not exist. On Cassandra and DSE, the connector creates the keyspace with
SimpleStrategyand a replication factor of 3, and the database user needs permission to create keyspaces. On Astra DB, the token in the password field needs the Database Administrator role, and the database enters maintenance for about 30 seconds while the connector creates the keyspace.Auto create table: Creates the table if it does not exist, with a column for each record field. The fields of the record key become the primary key, so both the key and the value need AVRO, JSON_SR, or PROTOBUF data. In
EXPLICITmode, map at least one key field, such askey.<field>, for each table.Auto evolve table: Adds a column to the table when records start carrying a new field, so schema changes do not need manual table updates. The connector only adds columns. It never drops or changes existing columns or the primary key. The connector cannot add a column for a nested record (struct), and sends such records to the dead letter queue (DLQ) when
errors.toleranceisall. InEXPLICITmode, only fields in the mapping get a column. This setting needs AVRO, JSON_SR, or PROTOBUF data.
Data decryption
Enable Client-Side Field Level Encryption for data decryption. Specify a Service Account to access the Schema Registry and associated encryption rules or keys with that schema. Select the connector behavior (
ERRORorNONE) on data decryption failure. If set toERROR, the connector fails and writes the encrypted data in the DLQ. If set toNONE, the connector writes the encrypted data in the target system without decryption. For more information on CSFLE or CSPE setup, see Manage encryption for connectors.
Show advanced configurations
Schema context: Select a schema context to use for this connector, if using a schema-based data format. This property defaults to the Default context, which configures the connector to use the default schema set up for Schema Registry in your Confluent Cloud environment. A schema context allows you to use separate schemas (like schema sub-registries) tied to topics in different Kafka clusters that share the same Schema Registry environment. For example, if you select a non-default context, a Source connector uses only that schema context to register a schema and a Sink connector uses only that schema context to read from. For more information about setting up a schema context, see What are schema contexts and when should you use them?.
Input Kafka record key format: Sets the input Kafka record key format. Valid entries are AVRO, BYTES, JSON, JSON_SR, PROTOBUF, or STRING. Note that you need to have Confluent Cloud Schema Registry configured if using a schema-based message format like AVRO, JSON_SR, and PROTOBUF.
Additional Configs
Value Converter Replace Null With Default: Specifies whether to replace fields that have a default value and that are null to the default value. When set to
true, the connector uses the default value; otherwise, it usesnull. Applies to theJSONconverter.Value Converter Schema ID Deserializer: Sets the class name of the schema ID deserializer for values. The deserializer reads schema IDs from message headers.
Value Converter Reference Subject Name Strategy: Sets the subject reference name strategy for values. Valid entries are
DefaultReferenceSubjectNameStrategyorQualifiedReferenceSubjectNameStrategy. You can use this strategy only withPROTOBUFformat; the default strategy isDefaultReferenceSubjectNameStrategy.Schema ID For Value Converter: Sets the schema ID to use for deserialization when using
ConfigSchemaIdDeserializer. This lets you specify a fixed schema ID for deserializing message values. This property is applicable only whenvalue.converter.value.schema.id.deserializeris set toConfigSchemaIdDeserializer.Value Converter Schemas Enable: Includes schema within each of the serialized values. Input messages must contain
schemaandpayloadfields and must not contain additional fields. For plainJSONdata, set this tofalse. Applies to theJSONconverter.Errors Tolerance: Use this property to configure the connector’s error handling behavior.
Warning
Use this property with caution for sink connectors, as it can lead to data loss. If you set this property to
all, the connector does not fail on errant records, but logs them (and sends to DLQ for sink connectors) and continues processing. If you set this property tonone, the connector task fails on errant records.Value Converter Ignore Default For Nullables: When set to
true, this property ensures that the corresponding record in Kafka isnull, instead of showing the default column value. Applies to theAVRO,PROTOBUF, andJSON_SRconverters.Key Converter Schema ID Deserializer: Sets the class name of the schema ID deserializer for keys. The deserializer reads schema IDs from message headers.
Value Converter Decimal Format: Specifies the
JSONorJSON_SRserialization format for ConnectDECIMALlogical type values with two allowed literals:BASE64to serializeDECIMALlogical types as base64 encoded binary data, andNUMERICto serializeDECIMALlogical type values inJSONorJSON_SRas a number representing the decimal value.Schema GUID For Key Converter: Sets the schema GUID to use for deserialization when using
ConfigSchemaIdDeserializer. This lets you specify a fixed schema GUID for deserializing message keys. This property is applicable only whenkey.converter.key.schema.id.deserializeris set toConfigSchemaIdDeserializer.Schema GUID For Value Converter: Sets the schema GUID to use for deserialization when using
ConfigSchemaIdDeserializer. This lets you specify a fixed schema GUID for deserializing message values. This property is applicable only whenvalue.converter.value.schema.id.deserializeris set toConfigSchemaIdDeserializer.Value Converter Connect Meta Data: Enables the Connect converter to add its metadata to the output schema. Applies to Avro converters.
Value Converter Value Subject Name Strategy: Determines how to construct the subject name under which the value schema is registered with Schema Registry.
Key Converter Key Subject Name Strategy: Determines how to construct the subject name for key schema registration.
Schema ID For Key Converter: Sets the schema ID to use for deserialization when using
ConfigSchemaIdDeserializer. This lets you specify a fixed schema ID for deserializing message keys. This property is applicable only whenkey.converter.key.schema.id.deserializeris set toConfigSchemaIdDeserializer.
Auto-restart policy
Enable Connector Auto-restart: Enables the auto-restart behavior of the connector and its task in the event of user-actionable errors. Defaults to
true, enabling the connector to automatically restart in case of user-actionable errors. Set this property tofalseto disable auto-restart for failed connectors. If disabled, you must manually restart the connector.
Consumer configuration
Max poll interval(ms): Sets the maximum delay between subsequent consume requests to Kafka. Use this property to improve connector performance in cases when the connector cannot send records to the sink system. The default is 300,000 milliseconds (5 minutes).
Max poll records: Sets the maximum number of records to consume from Kafka in a single request. Use this property to improve connector performance in cases when the connector cannot send records to the sink system. The default is 500 records.
Table mapping
Per-table / per-topic overrides: Optional JSON object of per-table and per-topic overrides. Per-table keys are
<topic>.<keyspace>.<table>.<setting>where<setting>is one ofconsistencyLevel,ttl,ttlTimeUnit,timestampTimeUnit,nullToUnset,deletesEnabled, orquery. Per-topic codec keys are<topic>.codec.<setting>where<setting>is one oflocale,timeZone,timestamp,date,time, orunit. Example:{"orders.ecom.orders.consistencyLevel":"LOCAL_QUORUM", "orders.ecom.orders.ttl":"3600", "orders.codec.timeZone":"UTC"}. Each entry materializes to the engine keytopic.<entry-key>.
Connection tuning
Max concurrent requests: Maximum number of requests to send to the database at once.
Max records per batch: Maximum number of records sent in a single UNLOGGED batch request.
Query execution timeout (s): CQL statement execution timeout, in seconds.
Local connection pool size: Number of connections the driver maintains to each node in the local datacenter.
Protocol compression: Compression algorithm to use for requests to the database server.
Transforms
Single Message Transformations: To add a new SMT, see Add transforms. For more information about unsupported SMTs, see Unsupported transformations.
For all property values and definitions, see Configuration Properties.
Click Continue.
Based on the number of topic partitions you select, Confluent Cloud recommends a number of tasks.
To change the number of recommended tasks, enter the number of tasks for the connector to use in the Tasks field.
Click Continue.
Verify the connection details.
Click Launch.
The status for the connector should go from Provisioning to Running.
Step 5: Check the target database
After the connector is running, verify that records are populating the mapped tables in your Cassandra, DSE, or Astra DB keyspace.
For more information and examples to use with the Confluent Cloud API for Connect, see the Confluent Cloud API for Connect Usage Examples section.
Tip
When you launch a connector, a Dead Letter Queue topic is automatically created. For more information, see View Connector Dead Letter Queue Errors 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.
Step 1: List the available connectors
Enter the following command to list available connectors:
confluent connect plugin list
Step 2: List the connector configuration properties
Enter the following command to show the connector configuration properties:
confluent connect plugin describe <connector-plugin-name>
The command output shows the required and optional configuration properties.
Step 3: Create the connector configuration file
Create a JSON file that contains the connector configuration properties. The following example shows the required properties for connecting to Apache Cassandra or DSE.
{
"connector.class": "DataStaxSink",
"name": "DataStaxSinkConnector_0",
"topics": "orders",
"kafka.auth.mode": "KAFKA_API_KEY",
"kafka.api.key": "<my-kafka-api-key>",
"kafka.api.secret": "<my-kafka-api-secret>",
"input.data.format": "AVRO",
"deployment.type": "Apache Cassandra or DSE",
"contactPoints": "<cassandra-host-1>,<cassandra-host-2>",
"port": "9042",
"loadBalancing.localDc": "<local-datacenter-name>",
"auth.provider": "PLAIN",
"auth.username": "<database-username>",
"auth.password": "<database-password>",
"mappingMode": "EXPLICIT",
"mapping.map": "{\"orders.ecom.orders\":\"id=value.id, amount=value.amount\"}",
"createKeyspace": "false",
"createTable": "false",
"evolveTable": "false",
"tasks.max": "1"
}
To connect to DataStax Astra DB instead, remove the contactPoints,
port, and loadBalancing.localDc properties and add the following properties:
{
"deployment.type": "DataStax Astra",
"cloud.secureConnectBundle": "data:application/octet-stream;base64,<base64-encoded-secure-connect-bundle>",
"auth.provider": "PLAIN",
"auth.username": "token",
"auth.password": "<astra-application-token>"
}
Note the following property definitions:
"connector.class": Identifies the connector plugin name."name": Sets a name for your new connector."topics": Identifies the topic name or a comma-separated list of topic names."input.data.format": Sets the input Kafka record value format. Valid entries are AVRO, JSON_SR, PROTOBUF, JSON, or BYTES. You must have Confluent Cloud Schema Registry configured if using a schema-based message format such as AVRO, JSON_SR, or PROTOBUF.
"kafka.auth.mode": Identifies the connector authentication mode you want to use. There are two options:SERVICE_ACCOUNTorKAFKA_API_KEY(the default). To use an API key and secret, specify the configuration propertieskafka.api.keyandkafka.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
"deployment.type": Sets which database you are connecting to. UseApache Cassandra or DSEto connect using contact points, orDataStax Astrato connect using an uploaded SCB."contactPoints": Comma-separated host names or IP addresses of the Cassandra or DSE cluster contact points. Applies only whendeployment.typeis set toApache Cassandra or DSE."loadBalancing.localDc": The name of the local datacenter the driver treats as local, for exampledc1. Required whendeployment.typeis set toApache Cassandra or DSE."cloud.secureConnectBundle": The base64-encoded Astra DB SCB, with the prefixdata:application/octet-stream;base64,. Required whendeployment.typeis set toDataStax Astra."mappingMode": Sets how the connector maps topics to tables. UseEXPLICITto map topics and fields yourself withmapping.map, orIMPLICITto write each topic to a table with the same name. The default isEXPLICIT. InIMPLICITmode, you must also set"keyspace"."createKeyspace","createTable", and"evolveTable": Turn on automatic creation of keyspaces and tables, and automatic addition of columns. All three default tofalse. For more information, see Automatic table management."mapping.map": A JSON object that maps each<topic>.<keyspace>.<table>to its field-to-column mapping. A single topic can map to multiple tables by adding multiple entries. For all mapping syntax and per-table override properties, see Configuration Properties.
Note
To enable CSFLE or CSPE for data encryption, specify the following properties:
csfle.enabled: Flag to indicate whether the connector honors CSFLE or CSPE rules.sr.service.account.id: A Service Account to access the Schema Registry and associated encryption rules or keys with that schema.csfle.onFailure: Configures the connector behavior (ERRORorNONE) on data decryption failure. If set toERROR, the connector fails and writes the encrypted data in the dead letter queue (DLQ). If set toNONE, the connector writes the encrypted data in the target system without decryption.
On a decryption failure, the connector writes the record to the DLQ in its original, still-encrypted form. The DLQ doesn’t expose the plaintext CSFLE-protected fields or the CSPE-protected payloads. Because all fields without an encryption rule are written to the DLQ as is, restrict access to the DLQ topic.
The Connect DLQ (errors.deadletterqueue.*) copies the raw bytes of
the original record. Fields that were tagged as sensitive are written to the
DLQ in plaintext, unencrypted. When a connector writes a message
to its DLQ, the defined encryption rule is not considered so field redaction
doesn’t take place. For more information, see Dead letter queues and CSFLE.
To avoid routing failed records to a DLQ, use an alternative approach for error handling:
Setting
csfle.onFailuretoNONEto pass encrypted data through to the target system without decryptionImplementing custom error handling in your applications
For more information on CSFLE or CSPE setup, see Manage encryption for connectors.
SMTs: For details about adding SMTs using the Confluent CLI, see the Single Message Transformations documentation.
For all configuration property values and descriptions, see Configuration Properties.
Step 4: Load the configuration file and create the connector
Enter the following command to load the configuration and start the connector:
confluent connect cluster create --config-file <file-name>.json
For example:
confluent connect cluster create --config-file datastax-sink-config.json
Example output:
Created connector DataStaxSinkConnector_0 lcc-ix4dl
Step 5: Check the connector status
Enter the following command to check the connector status:
confluent connect cluster list
Example output:
ID | Name | Status | Type
+-----------+----------------------------+---------+------+
lcc-ix4dl | DataStaxSinkConnector_0 | RUNNING | sink
Step 6: Check the target database
After the connector is running, verify that records are populating the mapped tables in your Cassandra, DSE, or Astra DB keyspace.
For more information and examples to use with the Confluent Cloud API for Connect, see the Confluent Cloud API for Connect Usage Examples section.
Tip
When you launch a connector, a Dead Letter Queue topic is automatically created. For more information, see View Connector Dead Letter Queue Errors in Confluent Cloud.
Automatic table management
By default, you create the keyspace and tables in your database before you start the connector. The connector can also create keyspaces and tables, add columns when records gain new fields, and write each topic to a table of the same name. These settings are off by default, so existing connectors are not affected.
Setting |
Property |
Default |
Purpose |
|---|---|---|---|
Mapping mode |
|
|
|
Keyspace name |
|
Empty |
Keyspace for the tables in |
Auto create keyspace |
|
|
Creates the keyspace if it does not exist. |
Auto create table |
|
|
Creates the table if it does not exist. |
Auto evolve table |
|
|
Adds a column when records start carrying a new field. |
Each of the three auto settings works on its own, in either mapping mode.
Mapping modes
- IMPLICIT mode
Set Mapping mode to
IMPLICIT, set a Keyspace name, and leave the field mapping empty. The connector writes topicordersto tableordersin that keyspace, and every field of the record key and value goes to the column of the same name. The connector lower-cases names, socustomerNamebecomescustomername. For this reason, topic names can use only letters, digits, and underscores.- EXPLICIT mode
This is the default. The field mapping decides the keyspace, table, and columns, and the connector does not write fields that are not in the mapping. The auto settings create only the keyspaces, tables, and columns named in the mapping.
Auto create keyspace
When the connector starts, it creates a missing keyspace. This is the
Keyspace name in IMPLICIT mode, or the keyspaces in the mapping in
EXPLICIT mode. The connector lower-cases the name unless you quote it, for
example "MyKeyspace".
On Cassandra and DSE, the connector creates the keyspace with
SimpleStrategyand a replication factor of 3. The database user needs permission to create keyspaces.If you turn off this setting, the keyspace must already exist.
On a cluster with fewer than three nodes, writes at the default
LOCAL_ONEconsistency level work, butQUORUMlevels can fail.
Auto create table
The connector creates the table when its first record arrives.
In
IMPLICITmode, the table gets a column for every key and value field.In
EXPLICITmode, the table gets a column for every mapped field. Map at least one key field, such askey.<field>, for each table.
The record key needs a schema too, because its fields become the primary key.
A key {orderId} gives PRIMARY KEY (orderid), and a key
{region, orderId} gives PRIMARY KEY ((region, orderid)).
Auto evolve table
When a record carries a new field, the connector adds the column before it writes that record. The connector cannot add a column for a nested record (struct), and sends such records to the dead letter queue (DLQ). For more information, see DataStax Sink Connector.
In
IMPLICITmode, any new field gets a column.In
EXPLICITmode, only fields in the mapping get a column. To store a new field, add it to the mapping.
The connector never removes or changes existing columns or the primary key.
Data format requirements
IMPLICITmode and Auto evolve table need a schema-based value.Auto create table needs a schema-based key and value.
Delete behavior
In
EXPLICITmode, a tombstone or a record whose non-key fields are all null deletes the row.In
IMPLICITmode, only a tombstone deletes the row.
Astra DB
On Astra DB, the connector creates keyspaces through the Astra API, so the Astra token needs the Database Administrator role. The database briefly enters maintenance, about 30 seconds, while the connector creates the keyspace.
Records that do not fit
If a record does not fit and errors.tolerance is all, the connector
sends it to the DLQ with a message that explains the fix, and keeps running. If
errors.tolerance is none, the connector fails. A record does not fit
when, for example, it has a new field in IMPLICIT mode while Auto evolve
table is off, or when a field type does not match its column. The connector
rejects invalid combinations, such as IMPLICIT mode without a keyspace,
when you create it.
For limitations, see DataStax Sink Connector.
Configuration Properties
Use the following configuration properties with the fully managed connector.
How should we connect to your data?
nameSets a name for your connector.
Type: string
Valid Values: A string at most 64 characters long
Importance: high
Schema Config
schema.context.nameAdd a schema context name. A schema context represents an independent scope in Schema Registry. It is a separate sub-schema tied to topics in different Kafka clusters that share the same Schema Registry instance. If not used, the connector uses the default schema configured for Schema Registry in your Confluent Cloud environment.
Type: string
Default: default
Importance: medium
Input messages
input.data.formatSets the input Kafka record value format. Valid entries are AVRO, JSON_SR, PROTOBUF, JSON or BYTES. 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
Importance: high
input.key.formatSets the input Kafka record key format. Valid entries are AVRO, BYTES, JSON, JSON_SR, PROTOBUF, or STRING. 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, BYTES, JSON, JSON_SR, PROTOBUF, STRING
Importance: high
Kafka Cluster credentials
kafka.auth.modeKafka Authentication mode. It can be one of KAFKA_API_KEY or SERVICE_ACCOUNT. It defaults to KAFKA_API_KEY mode, whenever possible.
Type: string
Valid Values: SERVICE_ACCOUNT, KAFKA_API_KEY
Importance: high
kafka.api.keyKafka API Key. Required when kafka.auth.mode==KAFKA_API_KEY.
Type: password
Importance: high
kafka.service.account.idThe Service Account that will be used to generate the API keys to communicate with Kafka Cluster.
Type: string
Importance: high
kafka.api.secretSecret associated with Kafka API key. Required when kafka.auth.mode==KAFKA_API_KEY.
Type: password
Importance: high
Which topics do you want to get data from?
topics.regexA regular expression that matches the names of the topics to consume from. This is useful when you want to consume from multiple topics that match a certain pattern without having to list them all individually.
Type: string
Importance: low
topicsIdentifies the topic name or a comma-separated list of topic names.
Type: list
Importance: high
errors.deadletterqueue.topic.nameThe name of the topic to be used as the dead letter queue (DLQ) for messages that result in an error when processed by this sink connector, or its transformations or converters. Defaults to ‘dlq-${connector}’ if not set. The DLQ topic will be created automatically if it does not exist. You can provide
${connector}in the value to use it as a placeholder for the logical cluster ID.Type: string
Default: dlq-${connector}
Importance: low
How should we connect to Cassandra / DSE / Astra?
deployment.typeWhich database you are connecting to. Choose
Apache Cassandra or DSEto connect via contact points (optionally with SSL/TLS), orDataStax Astrato connect via an uploaded Secure Connect Bundle. The two modes are mutually exclusive — the connector cannot use both at once. For CLI/Terraform provisioning, set this explicitly.Type: string
Default: Apache Cassandra or DSE
Valid Values: Apache Cassandra or DSE, DataStax Astra
Importance: high
contactPointsComma-separated host names or IPs of the Cassandra/DSE cluster contact points. Used only for the
Apache Cassandra or DSEdeployment type; leave empty for Astra (use the Secure Connect Bundle instead).Type: string
Default: “”
Importance: high
portCassandra/DSE native transport port (ignored for Astra).
Type: int
Default: 9042
Valid Values: [1,…]
Importance: low
loadBalancing.localDcName of the local datacenter the driver should treat as local (commonly
dc1). Required for theApache Cassandra or DSEdeployment type; must not be set for Astra.Type: string
Default: “”
Importance: medium
cloud.secureConnectBundleDataStax Astra DB Secure Connect Bundle (SCB). Required for the
DataStax Astradeployment type, and mutually exclusive with contact points / local datacenter / SSL settings. Upload the SCB zip file; for REST API usage base64-encode it and prefix withdata:application/octet-stream;base64,.Type: password
Importance: high
Authentication
auth.providerAuthentication provider to the database.
Nonefor no auth,PLAINfor username/password (also used for LDAP and for Astra token auth).Type: string
Default: None
Valid Values: None, PLAIN
Importance: medium
auth.usernameDatabase username (for
PLAINauth; for Astra token auth use the literaltoken).Type: string
Default: “”
Importance: medium
auth.passwordDatabase password (for
PLAINauth; for Astra token auth use theAstraCS:...token).Type: password
Importance: medium
Security (SSL/TLS)
ssl.providerSSL/TLS engine used for the connection to Cassandra/DSE.
Nonedisables SSL.JDKuses the JSSE keystore/truststore (JKS). Only applicable to theApache Cassandra or DSEdeployment type — Astra’s TLS material is carried inside the Secure Connect Bundle.Type: string
Default: None
Valid Values: JDK, None
Importance: medium
ssl.hostnameValidationWhether to validate the database node hostnames against the certificate when SSL is enabled.
Type: boolean
Default: true
Importance: medium
ssl.truststore.pathTruststore file (JKS) containing the CA certificate(s) that sign the database server certificates. Upload the file; for REST API usage base64-encode it and prefix with
data:application/octet-stream;base64,.Type: password
Importance: medium
ssl.truststore.passwordPassword protecting the truststore file (leave empty if the truststore has no password).
Type: password
Importance: medium
ssl.keystore.pathKeystore file (JKS) holding the client certificate + private key for mutual TLS (client authentication). Only needed when the database requires client certificates. Upload the file; for REST API usage base64-encode it and prefix with
data:application/octet-stream;base64,.Type: password
Importance: medium
ssl.keystore.passwordPassword protecting the keystore file (leave empty if the keystore has no password).
Type: password
Importance: medium
ssl.cipherSuitesOptional comma-separated list of TLS cipher suites to enable. Leave empty to use the JVM defaults.
Type: string
Default: “”
Importance: low
Table mapping
mappingModeHow records are written to tables. EXPLICIT (default): you map each topic to its tables, and fields to columns, in the topic-to-table field mapping. IMPLICIT: each topic is written to the table of the same name in Keyspace name, and each key and value field to the column of the same name. The table must already exist unless Auto create table is enabled. Names are lower-cased (Orders → orders, userId → userid), so topic names may only use letters, digits and underscores. IMPLICIT needs Avro, Protobuf or JSON Schema data.
Type: string
Default: EXPLICIT
Valid Values: EXPLICIT, IMPLICIT
Importance: high
keyspaceKeyspace for the tables in IMPLICIT mode (required there). In EXPLICIT mode, the keyspace is set in each mapping entry instead. Lower-cased unless wrapped in double quotes, e.g. “MyKeyspace”.
Type: string
Default: “”
Importance: high
mapping.mapJSON object that maps each <topic>.<keyspace>.<table> to its field-to-column mapping. Example: {“orders.ecom.orders”: “id=value.id, amount=value.amount”}. Use key.* for record-key fields (primary-key columns) and value.* for record-value fields. Each entry materializes to the engine key topic.<topic>.<keyspace>.<table>.mapping. A single topic can map to multiple tables (fan-out) by adding multiple entries. Required when mapping mode is EXPLICIT; must be empty when it is IMPLICIT.
Type: string
Default: {}
Importance: high
createKeyspaceCreate the keyspace if it doesn’t exist. On Astra, the token in the password field needs the Database Administrator role. On Cassandra/DSE, the keyspace is created with a replication factor of 3.
Type: boolean
Default: false
Importance: medium
createTableCreate the table if it doesn’t exist, with a column for each record field. The record key’s fields become the primary key, so both the key and the value need Avro, Protobuf or JSON Schema format. In EXPLICIT mode, map at least one key field for each table.
Type: boolean
Default: false
Importance: medium
evolveTableAdd a column to the table when records start carrying a new field, so schema changes don’t need manual table updates. Columns are only ever added; existing columns are never dropped or changed. Needs Avro, Protobuf or JSON Schema data.
Type: boolean
Default: false
Importance: medium
topic.override.mapOptional JSON object of per-table and per-topic overrides. Per-table keys are
<topic>.<keyspace>.<table>.<setting>where<setting>is one ofconsistencyLevel,ttl,ttlTimeUnit,timestampTimeUnit,nullToUnset,deletesEnabledorquery. Aqueryoverride must be a singleINSERTorUPDATEstatement targeting the same keyspace and table as its key. Per-topic codec keys are<topic>.codec.<setting>where<setting>is one oflocale,timeZone,timestamp,date,timeorunit. Example:{"orders.ecom.orders.consistencyLevel":"LOCAL_QUORUM", "orders.ecom.orders.ttl":"3600", "orders.codec.timeZone":"UTC"}. Each entry materializes to the engine keytopic.<entry-key>. Not supported whenmappingModeisIMPLICIT.Type: string
Default: {}
Importance: medium
Connection tuning
maxConcurrentRequestsMaximum number of requests to send to the database at once.
Type: int
Default: 500
Valid Values: [1,…,10000]
Importance: low
maxNumberOfRecordsInBatchMaximum number of records sent in a single UNLOGGED batch request.
Type: int
Default: 32
Valid Values: [1,…,1000]
Importance: low
queryExecutionTimeoutCQL statement execution timeout, in seconds.
Type: int
Default: 30
Valid Values: [1,…,300]
Importance: low
connectionPoolLocalSizeNumber of connections the driver maintains to each node in the local datacenter.
Type: int
Default: 4
Valid Values: [1,…,100]
Importance: low
compressionCompression algorithm to use for requests to the database server.
Type: string
Default: None
Valid Values: LZ4, None, SNAPPY
Importance: low
Consumer configuration
max.poll.interval.msThe maximum delay between subsequent consume requests to Kafka. This configuration property may be used to improve the performance of the connector, if the connector cannot send records to the sink system. Defaults to 300000 milliseconds (5 minutes).
Type: long
Default: 300000 (5 minutes)
Valid Values: [60000,…,1800000] for non-dedicated clusters and [60000,…] for dedicated clusters
Importance: low
max.poll.recordsThe maximum number of records to consume from Kafka in a single request. This configuration property may be used to improve the performance of the connector, if the connector cannot send records to the sink system. Defaults to 500 records.
Type: long
Default: 500
Valid Values: [1,…,500] for non-dedicated clusters and [1,…] for dedicated clusters
Importance: low
Number of tasks for this connector
tasks.maxMaximum number of tasks for the connector.
Type: int
Valid Values: [1,…]
Importance: high
Additional Configs
consumer.override.auto.offset.resetDefines the behavior of the consumer when there is no committed position (which occurs when the group is first initialized) or when an offset is out of range. You can choose either to reset the position to the “earliest” offset (the default) or the “latest” offset. You can also select “none” if you would rather set the initial offset yourself and you are willing to handle out of range errors manually. More details: https://docs.confluent.io/platform/current/installation/configuration/consumer-configs.html#auto-offset-reset
Type: string
Importance: low
consumer.override.isolation.levelControls how to read messages written transactionally. If set to read_committed, consumer.poll() will only return transactional messages which have been committed. If set to read_uncommitted (the default), consumer.poll() will return all messages, even transactional messages which have been aborted. Non-transactional messages will be returned unconditionally in either mode. More details: https://docs.confluent.io/platform/current/installation/configuration/consumer-configs.html#isolation-level
Type: string
Importance: low
header.converterThe converter class for the headers. This is used to serialize and deserialize the headers of the messages.
Type: string
Importance: low
key.converter.use.schema.guidThe schema GUID to use for deserialization when using ConfigSchemaIdDeserializer. This allows you to specify a fixed schema GUID to be used for deserializing message keys. Only applicable when key.converter.key.schema.id.deserializer is set to ConfigSchemaIdDeserializer.
Type: string
Importance: low
key.converter.use.schema.idThe schema ID to use for deserialization when using ConfigSchemaIdDeserializer. This allows you to specify a fixed schema ID to be used for deserializing message keys. Only applicable when key.converter.key.schema.id.deserializer is set to ConfigSchemaIdDeserializer.
Type: int
Importance: low
value.converter.allow.optional.map.keysAllow optional string map key when converting from Connect Schema to Avro Schema. Applicable for Avro Converters.
Type: boolean
Importance: low
value.converter.auto.register.schemasSpecify if the Serializer should attempt to register the Schema.
Type: boolean
Importance: low
value.converter.connect.meta.dataAllow the Connect converter to add its metadata to the output schema. Applicable for Avro Converters.
Type: boolean
Importance: low
value.converter.enhanced.avro.schema.supportEnable enhanced schema support to preserve package information and Enums. Applicable for Avro Converters.
Type: boolean
Importance: low
value.converter.enhanced.protobuf.schema.supportEnable enhanced schema support to preserve package information. Applicable for Protobuf Converters.
Type: boolean
Importance: low
value.converter.flatten.unionsWhether to flatten unions (oneofs). Applicable for Protobuf Converters.
Type: boolean
Importance: low
value.converter.generate.index.for.unionsWhether to generate an index suffix for unions. Applicable for Protobuf Converters.
Type: boolean
Importance: low
value.converter.generate.struct.for.nullsWhether to generate a struct variable for null values. Applicable for Protobuf Converters.
Type: boolean
Importance: low
value.converter.int.for.enumsWhether to represent enums as integers. Applicable for Protobuf Converters.
Type: boolean
Importance: low
value.converter.latest.compatibility.strictVerify latest subject version is backward compatible when use.latest.version is true.
Type: boolean
Importance: low
value.converter.object.additional.propertiesWhether to allow additional properties for object schemas. Applicable for JSON_SR Converters.
Type: boolean
Importance: low
value.converter.optional.for.nullablesWhether nullable fields should be specified with an optional label. Applicable for Protobuf Converters.
Type: boolean
Importance: low
value.converter.optional.for.proto2Whether proto2 optionals are supported. Applicable for Protobuf Converters.
Type: boolean
Importance: low
value.converter.scrub.invalid.namesWhether to scrub invalid names by replacing invalid characters with valid characters. Applicable for Avro and Protobuf Converters.
Type: boolean
Importance: low
value.converter.use.latest.versionUse latest version of schema in subject for serialization when auto.register.schemas is false.
Type: boolean
Importance: low
value.converter.use.optional.for.nonrequiredWhether to set non-required properties to be optional. Applicable for JSON_SR Converters.
Type: boolean
Importance: low
value.converter.use.schema.guidThe schema GUID to use for deserialization when using ConfigSchemaIdDeserializer. This allows you to specify a fixed schema GUID to be used for deserializing message values. Only applicable when value.converter.value.schema.id.deserializer is set to ConfigSchemaIdDeserializer.
Type: string
Importance: low
value.converter.use.schema.idThe schema ID to use for deserialization when using ConfigSchemaIdDeserializer. This allows you to specify a fixed schema ID to be used for deserializing message values. Only applicable when value.converter.value.schema.id.deserializer is set to ConfigSchemaIdDeserializer.
Type: int
Importance: low
value.converter.wrapper.for.nullablesWhether nullable fields should use primitive wrapper messages. Applicable for Protobuf Converters.
Type: boolean
Importance: low
value.converter.wrapper.for.raw.primitivesWhether a wrapper message should be interpreted as a raw primitive at root level. Applicable for Protobuf Converters.
Type: boolean
Importance: low
errors.toleranceUse this property if you would like to configure the connector’s error handling behavior. WARNING: This property should be used with CAUTION for SOURCE CONNECTORS as it may lead to dataloss. If you set this property to ‘all’, the connector will not fail on errant records, but will instead log them (and send to DLQ for Sink Connectors) and continue processing. If you set this property to ‘none’, the connector task will fail on errant records.
Type: string
Default: all
Importance: low
key.converter.key.schema.id.deserializerThe class name of the schema ID deserializer for keys. This is used to deserialize schema IDs from the message headers.
Type: string
Default: io.confluent.kafka.serializers.schema.id.DualSchemaIdDeserializer
Importance: low
key.converter.key.subject.name.strategyHow to construct the subject name for key schema registration.
Type: string
Default: TopicNameStrategy
Importance: low
key.converter.replace.null.with.defaultWhether to replace fields that have a default value and that are null to the default value. When set to true, the default value is used, otherwise null is used. Applicable for JSON Key Converter.
Type: boolean
Default: true
Importance: low
key.converter.schemas.enableInclude schemas within each of the serialized keys. Input message keys must contain schema and payload fields and may not contain additional fields. For plain JSON data, set this to false. Applicable for JSON Key Converter.
Type: boolean
Default: false
Importance: low
value.converter.decimal.formatSpecify 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
value.converter.flatten.singleton.unionsWhether to flatten singleton unions. Applicable for Avro and JSON_SR Converters.
Type: boolean
Default: false
Importance: low
value.converter.ignore.default.for.nullablesWhen set to true, this property ensures that the corresponding record in Kafka is NULL, instead of showing the default column value. Applicable for AVRO,PROTOBUF and JSON_SR Converters.
Type: boolean
Default: false
Importance: low
value.converter.reference.subject.name.strategySet the subject reference name strategy for value. Valid entries are DefaultReferenceSubjectNameStrategy or QualifiedReferenceSubjectNameStrategy. Note that the subject reference name strategy can be selected only for PROTOBUF format with the default strategy being DefaultReferenceSubjectNameStrategy.
Type: string
Default: DefaultReferenceSubjectNameStrategy
Importance: low
value.converter.replace.null.with.defaultWhether to replace fields that have a default value and that are null to the default value. When set to true, the default value is used, otherwise null is used. Applicable for JSON Converter.
Type: boolean
Default: true
Importance: low
value.converter.schemas.enableInclude schemas within each of the serialized values. Input messages must contain schema and payload fields and may not contain additional fields. For plain JSON data, set this to false. Applicable for JSON Converter.
Type: boolean
Default: false
Importance: low
value.converter.value.schema.id.deserializerThe class name of the schema ID deserializer for values. This is used to deserialize schema IDs from the message headers.
Type: string
Default: io.confluent.kafka.serializers.schema.id.DualSchemaIdDeserializer
Importance: low
value.converter.value.subject.name.strategyDetermines how to construct the subject name under which the value schema is registered with Schema Registry.
Type: string
Default: TopicNameStrategy
Importance: low
Auto-restart policy
auto.restart.on.user.errorEnable connector to automatically restart on user-actionable errors.
Type: boolean
Default: true
Importance: medium
Frequently asked questions
Find answers to frequently asked questions about the DataStax Sink connector for Confluent Cloud.
When to choose Apache Cassandra or DSE versus DataStax Astra?
Set deployment.type to Apache Cassandra or DSE when you connect to
a self-managed Apache Cassandra or DSE cluster using contact points, with
optional SSL/TLS. Set it to DataStax Astra when you connect to an
Astra DB database using an uploaded SCB. The two modes
are mutually exclusive.
Why does the connector fail with a missing keyspace or table error?
By default, the connector does not create keyspaces or tables, and fails if a
mapped keyspace or table is missing. Create the target schema in your
Cassandra, DSE, or Astra DB database before you start the connector, or turn
on Auto create keyspace and Auto create table. For more information,
see Automatic table management. The connector never creates
UDTs. Confirm that each entry in mapping.map references a keyspace and
table that exist or that the connector can create.
Can I use a custom Cassandra Query Language (CQL) query instead of the auto-generated INSERT?
Yes, using the query per-table override. When you use query, set
deletesEnabled to false for the same table. Use
this option only for idempotent statements. Because the connector provides
at-least-once delivery, a conditional write such as IF NOT EXISTS or a
counter update can apply more than once on retry.
Next Steps
For an example that shows fully managed Confluent Cloud connectors in action with Confluent Cloud for Apache Flink, see the Cloud ETL Demo. This example also shows how to use Confluent CLI to manage your resources in Confluent Cloud.