Overview
You can configure a CKafka connector to consume content in CKafka message queues. A CKafka connector is implemented in the pull pattern. It automatically pulls CKafka content and routes events to relevant services through event rules. This document describes how to create a CKafka connector and the structure of events generated by the CKafka connector.
Prerequisites
Directions
2. In the Event Bus list, select the event bus for which you want to configure a CKafka connector.
3. On the Event Bus Details page, click Add in the connector configuration section.
4. Enter the relevant information as prompted as shown below:
Here, select CMQ (Kafka) for Connector type and enter other configuration items as prompted. Note:
Currently, only delivery for Tencent Cloud CKafka instances is supported. Please confirm that no username and password have been configured for your CKafka instances; otherwise, the connector may fail to get messages.
5. Click OK.
6. Select Event Rule on the left sidebar.
7. In the drop-down lists at the top of the Event Rule page, select the same connector information as that set during connector creation and click Create Event Rule as shown below:
8. Enter the relevant information as prompted as shown below:
Here, select Message Queue CKafka for Tencent Cloud service and configure the delivery target. 9. Click OK.
Structure of events generated by the CKafka connector
{
"specversion":"1.0",
"id":"13a3f42d-7258-4ada-da6d-023a333b4662",
"type":"connector:kafka",
"source":"ckafka.cloud.tencent",
"subject": "qcs::ckafka:ap-guangzhou:uin/1250000000:ckafkaId/uin/1250000000/ckafka-123456",
"time":"1615430559146",
"region":"ap-guangzhou",
"datacontenttype":"application/json;charset=utf-8",
"data":{
"topic":"test-topic",
"Partition":1,
"offset":37,
"msgKey":"test",
"msgBody":"Hello from Ckafka again!"
}
}
The parameters are described as follows:
|
| |
| Event source partition. One topic can contain one or more partitions. CKafka uses partition as an allocation unit. |
| Consumer group, which specifies the consumption start point. |
| |
| |
Was this page helpful?