tencent cloud

Running the Kafka Client (Optional)
Last updated:2026-01-20 16:43:55
Running the Kafka Client (Optional)
Last updated: 2026-01-20 16:43:55

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:




Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback