tencent cloud

Running Kafka Client (Optional)
Last updated: 2025-08-13 14:55:58
Running Kafka Client (Optional)
Last updated: 2025-08-13 14:55:58

Scenarios

After configuring resources such as instances and topics in the console, you can also download and unzip the Kafka toolkit and perform simple send/receive message tests with the Kafka API.

Prerequisites

Completed the initial stage of CKafka resource creation.
Refer to Preparations to complete Linux server preparation and environment configuration.

Operation Steps

1. Download and decompress the Kafka installation package (Kafka installation package official download address).
2. Upload the downloaded Demo to a Linux server in the same VPC, then log in to the Linux server.
3. To produce and consume messages through CLI commands, go to . /bin Under contents.
3.1 Open the terminal to 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. Obtain them in the access method module on the console instance detail page.

topic: Replace XXXX with the topic name, and get it on the topic management page in the console.
3.2 Open another terminal window to 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. Obtain them in the access method module on the console instance detail page.

topic: Replace XXXX with the topic name, and get it on the topic management page in the console.
3.3 After entering the message content and pressing Enter, you can see that the consumer end also receives the message almost at the same time.
Production message:



Consumption message:





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

Feedback