tencent cloud

Serverless Cloud Function

Release Notes and Announcements
Release Notes
Announcements
User Guide
Product Introduction
Overview
Related Concepts
How It Works
Strengths
Scenarios
Related Products
Purchase Guide
Billing Overview
Billing Mode
Billable Items and Billing Modes
Function Computing Power Support
Free Tier
SCF Pricing
Billing Example
Payment Overdue
Getting Started
Creating Event Function in Console
User Guide
Quota Management
Managing Functions
Web Function Management
Log Management
Concurrence Management
Trigger Management
Function URL
A Custom Domain Name
Version Management
Alias Management
Permission Management
Running Instance Management
Plugin Management
Managing Monitors and Alarms
Network Configuration
Layer Management
Execution Configuration
Extended Storage Management
DNS Caching Configuration
Resource Managed Mode Management
Near-Offline Resource Hosting Model
Workflow
Triggers
Trigger Overview
Trigger Event Message Structure Summary
API Gateway Trigger
COS Trigger
CLS Trigger
Timer Trigger
CKafka Trigger
Apache Kafka Trigger
MQTT Trigger
Trigger Configuration Description
MPS Trigger
CLB Trigger Description
TencentCloud API Trigger
Development Guide
Basic Concepts
Testing a Function
Environment Variables
Dependency Installation
Using Container Image
Error Types and Retry Policies
Dead Letter Queue
Connecting SCF to Database
Automated Deployment
Cloud Function Status Code
Common Errors and Solutions
Developer Tools
Serverless Web IDE
Calling SDK Across Functions
Third-Party Tools
Code Development
Python
Node.js
Golang
PHP
Java
Custom Runtime
Deploying Image as Function
Web Framework Development
Deploying Framework on Command Line
Quickly Deploying Egg Framework
Quickly Deploying Express Framework
Quickly Deploying Flask Framework
Quickly Deploying Koa Framework
Quickly Deploying Laravel Framework
Quickly Deploying Nest.js Framework
Quickly Deploying Next.js Framework
Quickly Deploying Nuxt.js Framework
Quickly Deploying Django Framework
Use Cases
Overview
Solutions with Tencent Cloud Services
Business Development
TRTC Practices
COS Practices
CKafka Practice
CLS
CLB Practice
MPS
CDN
CDWPG
VOD
SMS
ES
Scheduled Task
Video Processing
Success Stories
Tencent Online Education
Online Video Industry
Tencent Online Education
Best Practice of Tencent IEG Going Global
API Documentation
History
Introduction
API Category
Making API Requests
Other APIs
Namespace APIs
Layer Management APIs
Async Event Management APIs
Trigger APIs
Function APIs
Function and Layer Status Description
Data Types
Error Codes
SDK Documentation
FAQs
General
Web Function
Billing FAQs
Network FAQs
Log FAQs
SCF utility class
Event Handling FAQs
API Gateway Trigger FAQs
Related Agreement
Service Level Agreement
Contact Us
Glossary

SCF + CKafka for Message Dump to CKafka

PDF
フォーカスモード
フォントサイズ
最終更新日: 2024-12-02 16:35:34

Overview

CKafka allows you to dump messages to another CKafka cluster to sync data between CKafka clusters.

Prerequisites

Currently, this feature relies on the SCF and CKafka services, which should be activated first before you can use this feature.

Directions

Dumping message

Message dump to CKafka will be performed with the CKafka trigger in SCF to sync messages to another CKafka cluster.
1. Log in to the CKafka console.
2. Click Instance List on the left sidebar and click the ID/Name of the target instance to enter the instance details page.
3. On the instance details page, select the Topic Management tab and click Message Dump in the Operation column.
4. Click Add Message Dump and select CKafka as the dump type.
Dump Type: select CKafka.
Dump Instance: pull the list of CKafka instances in the current region. If you want to dump data to an instance in another region or self-built Kafka, see Custom dump settings.
Dump Topic: pull the CKafka topic information of the selected instance.
Starting Position: the topic offset of historical messages when dumping.
Role Authorization: to use the SCF service, you need to grant a third-party role to perform access to related products for you.
SCF Authorization: indicate your consent to activating SCF and create a function. Then, you need to go to the function settings to set more advanced configuration items and view monitoring information.
5. After configuring the dump task, click Submit. After it is successfully created, dump will not start immediately; instead, you need to manually enable dump in the console.

Custom dump settings

In the general creation process, dump cannot be performed directly across regions or in self-built Kafka. For such dump, you need to configure the network or delivery information for the function. The cross-region dump process is as follows:
1. Create a CKafka dump template, go to the SCF console, and configure the delivery instance and topic as needed.
2. Modify Environment Variable and Network settings in the function configuration.
Environment variable configuration description: kafka_address: Kafka IP address. kafka_topic_name: Kafka topic name.
Note:
To dump CKafka data across regions, simply modify the relevant environment variables. You need to configure a peering connection for VPC.
For a CVM-based self-built Kafka instance, you need to change them to the VPC and Kafka topic of the instance.
For other self-built Kafka instances, you need to change the IP and topic in the environment variable to the information of the instance. If there is no Direct Connect, data needs to be transferred over the SCF public network.
3. Save the configurations and enable the dump feature.

Notes

Access methods

SCF supports two CKafka access methods: PLAINTEXT and SASL_PLAINTEXT, which can be modified in the SCF code.
PLAINTEXT access method:
kafka_to_kafka = KafkaToKafka(kafka_address)
SASL_PLAINTEXT access method:
kafka_to_kafka= KafkaToKafka(
kafka_address
security_protocol = "SASL_PLAINTEXT",
sasl_mechanism="PLAIN",
sasl_plain_username="ckafka-80o10xxx#Taborxx",
sasl_plain_password="Taborxxxx",
api_version=(0, 10, 2)
)
Note:
sasl_plain_username consists of Instance ID and username concatenated with #.

Viewing dump log and troubleshooting

CKafka dump capabilities are implemented based on SCF, and you can find relevant dump information and status in the SCF log.

Restrictions and Billing

The dump speed is subject to the limit of the peak bandwidth of the CKafka instance. If the consumption is too slow, check the peak bandwidth settings.
The CKafkaToCKafka scheme uses the CKafka trigger. For more information on related settings such as retry policy and maximum number of messages, see CKafka Trigger.
When the dump to CKafka feature is used, the dumped messages are the offset and msgBody data of the CKafka trigger by default. If you want to process the logic by yourself, see Event Message Structure for CKafka Trigger.
This feature is provided based on the SCF service that provides a free tier. For more information on the fees for excessive usage, see the billing rules of SCF.

ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック