tencent cloud

TDMQ for CKafka

Release Notes and Announcements
Release Notes
Broker Release Notes
Announcement
Product Introduction
Introduction and Selection of the TDMQ Product Series
What Is TDMQ for CKafka
Strengths
Scenarios
Technology Architecture
Product Series Introduction
Apache Kafka Version Support Description
Comparison with Apache Kafka
High Availability
Use Limits
Regions and AZs
Related Cloud Services
Billing
Billing Overview
Pricing
Billing Example
Changing from Postpaid by Hour to Monthly Subscription
Renewal
Viewing Consumption Details
Overdue Payments
Refund
Getting Started
Guide for Getting Started
Preparations
VPC Network Access
Public Domain Name Access
User Guide
Usage Process Guide
Configuring Account Permission
Creating Instance
Configuring Topic
Connecting Instance
Managing Messages
Managing Consumer Group
Managing Instance
Changing Instance Specification
Configuring Traffic Throttling
Configuring Elastic Scaling Policy
Configuring Advanced Features
Viewing Monitoring Data and Configuring Alarm Rules
Synchronizing Data Using CKafka Connector
Use Cases
Cluster Resource Assessment
Client Practical Tutorial
Log Integration
Open-Source Ecosystem Integration
Replacing Supporting Route (Old)
Migration Guide
Migration Solution Overview
Migrating Cluster Using Open-Source Tool
Troubleshooting
Topics
Clients
Messages
​​API Reference
History
Introduction
API Category
Making API Requests
Other APIs
ACL APIs
Instance APIs
Routing APIs
DataHub APIs
Topic APIs
Data Types
Error Codes
SDK Reference
SDK Overview
Java SDK
Python SDK
Go SDK
PHP SDK
C++ SDK
Node.js SDK
SDK for Connector
Security and Compliance
Permission Management
Network Security
Deletion Protection
Event Record
CloudAudit
FAQs
Instances
Topics
Consumer Groups
Client-Related
Network-Related
Monitoring
Messages
Agreements
CKafka Service Level Agreements
Contact Us
Glossary

Running Kafka Client (Optional)

PDF
포커스 모드
폰트 크기
마지막 업데이트 시간: 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 completed the environment configuration by seeing Preparations.

Operation Steps

1. Download and extract the Kafka installation package. (Official download address for Kafka installation package)
2. Configure the access control list (ACL) policies locally.
2.1 In the ./config directory of the toolkit, add the following content at the end of producer.properties and consumer.properties files:
security.protocol=SASL_PLAINTEXT
sasl.mechanism=PLAIN
2.2 Create a file named ckafka_client_jaas.conf with the following content:
KafkaClient {
org.apache.kafka.common.security.plain.PlainLoginModule required
username="yourinstance#yourusername"
password="yourpassword";
};
Note:
username is in the format of instance ID + # + configured username, and password is the configured user password.
2.3 In the ./bin directory of the toolkit, add the JAAS file path declaration (using the full path) at the beginning of the kafka-console-producer.sh and kafka-console-consumer.sh files.
export KAFKA_OPTS="-Djava.security.auth.login.config=****/config/ckafka_client_jaas.conf"
3. Produce and consume messages using command-line interface (CLI) commands.
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:
broker-list: Replace XXXX:port with the public network access domain name and port. 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:
broker-list: Replace XXXX:port with the public network access domain name and port. 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:





도움말 및 지원

문제 해결에 도움이 되었나요?

피드백