tencent cloud

TDMQ for CKafka

Running the Kafka Client (Optional)

下载
聚焦模式
字号
最后更新时间: 2026-01-20 16:43:55
本文档由 AI 翻译

Scenarios

After completing the configuration of instances, topics, and other resources in the console, you can also download and decompress the Kafka toolkit and perform simple message sending and receiving tests through the Kafka API.

Prerequisites

You have created the required TDMQ for CKafka (CKafka) resources.
You have prepared the Linux server and configured the environment by referring to Preparations.

Operation Steps

1. Download and extract the Kafka installation package. (Official download address for Kafka installation package)
2. Upload the downloaded Demo to a Linux server within the same Virtual Private Cloud (VPC) network, and then log in to the Linux server.
3. To produce and consume messages using command-line interface (CLI) commands, go to the ./bin directory.
3.1 Open the terminal and start the consumer.
bash kafka-console-consumer.sh --bootstrap-server XXXX:port --topic XXXX --consumer.config ../config/consumer.properties
Note:
Replace XXXX:port with the domain name and port for VPC network access. You can obtain it in the Access Mode module on the instance details page in the console.

Topic: Replace XXXX with the topic name. You can obtain it from the Topic List page in the console.
3.2 Open another terminal window and start the producer.
bash kafka-console-producer.sh --broker-list XXXX:port --topic XXXX --producer.config ../config/producer.properties
Note:
Replace XXXX:port with the domain name and port for VPC network access. You can obtain it in the Access Mode module on the instance details page in the console.

Topic: Replace XXXX with the topic name. You can obtain it from the Topic List page in the console.
3.3 After you enter the message content and press Enter, the consumer receives the message almost simultaneously.
Produce messages:



Consume messages:





帮助和支持

本页内容是否解决了您的问题?

填写满意度调查问卷,共创更好文档体验。

文档反馈