Skip to main content
Skip to main content

Doris Kafka Connector

Kafka Connect is a scalable and reliable tool for data transmission between Apache Kafka and other systems. Connectors can be defined Move large amounts of data in and out of Kafka.

The Doris community provides the doris-kafka-connector plug-in, which can write data in the Kafka topic to Doris.

Usage Doris Kafka Connector​



maven dependencies


Standalone mode startup​


# Modify broker address

Configure Create in the config directory and configure the following content:


Start Standalone

$KAFKA_HOME/bin/ -daemon $KAFKA_HOME/config/ $KAFKA_HOME/config/

Note: It is generally not recommended to use standalone mode in a production environment.

Distributed mode startup​


# Modify broker address

# Modify, the same cluster needs to be consistent

Start Distributed

$KAFKA_HOME/bin/ -daemon $KAFKA_HOME/config/

Add Connector

curl -i -H "Content-Type: application/json" -X POST -d '{
"": "topic_test:test_kafka_tbl",

Operation Connector

# View connector status
curl -i -X GET
# Delete connector
curl -i -X DELETE
# Pause connector
curl -i -X PUT
# Restart connector
curl -i -X PUT
# Restart tasks within the connector
curl -i -X POST

Refer to: Connect REST Interface


Note that when kafka-connect is started for the first time, three topics and will be created in the kafka cluster to record the shared connector configuration of kafka-connect. Offset data and status updates. How to Use Kafka Connect - Get Started

Access an SSL-certified Kafka cluster​

Accessing an SSL-certified Kafka cluster through kafka-connect requires the user to provide a certificate file (client.truststore.jks) used to authenticate the Kafka Broker public key. You can add the following configuration in the file:

# Connect worker

# Embedded consumer for sink connectors

For instructions on configuring a Kafka cluster connected to SSL authentication through kafka-connect, please refer to: Configure Kafka Connect

Dead letter queue​

By default, any errors encountered during or during the conversion will cause the connector to fail. Each connector configuration can also tolerate such errors by skipping them, optionally writing the details of each error and failed operation as well as the records in question (with varying levels of detail) to a dead-letter queue for logging.


Configuration items​

KeyDefault ValueRequiredDescription
name-YConnect application name, must be unique within the Kafka Connect environment
topics-YList of subscribed topics, separated by commas. like: topic1, topic2
doris.urls-YDoris FE connection address. If there are multiple, separate them with commas. like:,,
doris.http.port-YDoris HTTP protocol port
doris.query.port-YDoris MySQL protocol port
doris.user-YDoris username
doris.password-YDoris password
doris.database-YThe database to write to. It can be empty when there are multiple libraries. At the same time, the specific library name needs to be configured in corresponding relationship between topic and table table, for example: topic1:tb1,topic2:tb2
The default is empty, indicating that topic and table names correspond one to one.
The format of multiple libraries is topic1:db1.tbl1,topic2:db2.tbl2
buffer.count.records10000NThe number of records each Kafka partition buffers in memory before flushing to doris. Default 10000 records
buffer.flush.time120NBuffer refresh interval, in seconds, default 120 seconds
buffer.size.bytes5000000(5MB)NThe cumulative size of records buffered in memory for each Kafka partition, in bytes, default 5MB
jmxtrueNTo obtain connector internal monitoring indicators through JMX, please refer to: Doris-Connector-JMX
enable.deletefalseNWhether to delete records synchronously, default false
label.prefix${name}NStream load label prefix when importing data. Defaults to the Connector application name.
auto.redirecttrueNWhether to redirect StreamLoad requests. After being turned on, StreamLoad will redirect to the BE where data needs to be written through FE, and the BE information will no longer be displayed.
load.modelstream_loadNHow to import data. Supports stream_load to directly import data into Doris; also supports copy_into to import data into object storage, and then load the data into Doris.*'':'json',
NImport parameters for Stream Load.
For example: define column separator '':','
Detailed parameter reference here
delivery.guaranteeat_least_onceNHow to ensure data consistency when consuming Kafka data is imported into Doris. Supports at_least_once exactly_once, default is at_least_once. Doris needs to be upgraded to 2.1.0 or above to ensure data exactly_once

For other Kafka Connect Sink common configuration items, please refer to: connect_configuring