ahn heesuk
03/25/2026, 4:08 AMRocky
03/25/2026, 4:08 AMahn heesuk
03/25/2026, 4:10 AMRocky
03/25/2026, 4:11 AMconnect-StarRocks-sink.properties)
Create a configuration file for the StarRocks sink:
properties
name=starrocks-kafka-connector
connector.class=com.starrocks.connector.kafka.StarRocksSinkConnector
topics=your_kafka_topic
key.converter=org.apache.kafka.connect.json.JsonConverter
value.converter=org.apache.kafka.connect.json.JsonConverter
key.converter.schemas.enable=true
value.converter.schemas.enable=false
# StarRocks FE HTTP URL (default port 8030)
starrocks.http.url=192.168.x.x:8030
starrocks.database.name=your_db
starrocks.username=root
starrocks.password=your_password
# Mapping Kafka topics to StarRocks tables
starrocks.topic2table.map=your_kafka_topic:your_starrocks_table
sink.properties.strip_outer_array=true
B. Configure Kafka Connect (connect-standalone.properties)
Ensure the plugin.path points to the directory containing the StarRocks connector JAR:
properties
bootstrap.servers=kafka-broker:9092
offset.storage.file.filename=/tmp/connect.offsets
plugin.path=/path/to/starrocks-kafka-connector
4. Running the Connector
You can start the connector using the following command:
bash
CLASSPATH=/path/to/connector/* bin/connect-standalone.sh \
config/connect-standalone.properties \
config/connect-StarRocks-sink.properties
5. Handling CDC Data (Debezium)
If you are loading CDC data into a Primary Key table, you need to add specific transformations to your connector config to handle operations like upsert and `delete`:
properties
transforms=addfield,unwrap
transforms.addfield.type=com.starrocks.connector.kafka.transforms.AddOpFieldForDebeziumRecord
transforms.unwrap.type=io.debezium.transforms.ExtractNewRecordState
transforms.unwrap.drop.tombstones=true
transforms.unwrap.delete.handling.mode=rewrite
Key Parameters
* `starrocks.http.url`: The HTTP URL of the Frontends (FE).
* `starrocks.topic2table.map`: Maps Kafka topics to StarRocks tables if they have different names.
_ `sink.properties._`: You can pass additional Stream Load properties (like column_separator) by prefixing them with sink.properties..
For more advanced setups (like Distributed Mode via REST API), please refer to the official documentation on loading data with the Kafka connector.
References
• loading/Kafka-connector-starrocks.mdahn heesuk
03/25/2026, 4:46 AMconfluent schema registry to decode protobuf?Rocky
03/25/2026, 4:46 AMahn heesuk
03/25/2026, 4:47 AMschema registry to decode protobuf?Rocky
03/25/2026, 4:47 AMkafka-connector-starrocks (the Kafka Connect sink connector) to load Protobuf data, a Schema Registry is typically required.
Here is the breakdown of why and how it differs from other methods:
1. Kafka Connector Mechanism
The kafka-connector-starrocks runs within the Kafka Connect framework. It relies on Kafka Connect Converters to deserialize data from Kafka topics into a format the connector can understand.
* To decode Protobuf messages, you would normally use the io.confluent.connect.protobuf.ProtobufConverter.
* This converter is designed to work with the Confluent Schema Registry to fetch the schema needed to deserialize the binary Protobuf bytes into structured data.
* Configuration typically looks like this:
properties
value.converter=io.confluent.connect.protobuf.ProtobufConverter
value.converter.schema.registry.url=<http://localhost:8081>
2. Difference from Routine Load
It is important to distinguish the Kafka Connector from StarRocks' built-in Routine Load feature:
* Routine Load: Supports Protobuf and allows you to provide a local .proto file directly in the CREATE ROUTINE LOAD statement. In this case, a Schema Registry is not required.
* Kafka Connector: Does not natively parse .proto files. It expects the Kafka Connect framework to handle the conversion. Since the standard Protobuf converter for Kafka Connect requires a Schema Registry, the connector effectively requires one too.
Summary Table
Feature | Protobuf Support | Schema Registry Required? | How it works
Kafka Connector | Yes | Yes | Uses Kafka Connect converters (e.g., Confluent ProtobufConverter).
Routine Load | Yes | No | You upload/reference a .proto file in the load job.
Recommendation:
* If you already have a Schema Registry in your ecosystem, the Kafka Connector is a great choice as it integrates seamlessly.
* If you do not want to use a Schema Registry and have the .proto files available, using Routine Load is the simpler and more direct approach.
References
• loading/Kafka-connector-starrocks.md