Implementation and Verification
Constraints
- Custom certificates are not supported in the event target DMS for Kafka.
- The size of a single message must be less than 2 MB.
Configuring the Source
- Log in to the EG console.
- In the navigation pane, choose Event Streams > Serverless Event Streams. Click Create Serverless Event Stream.
- Click
in the upper left corner to configure the event stream name and description, and click OK.
- Configure a Kafka event source.
- Click Event Source.
- Select Distributed Message Service (DMS) for Kafka for Event Provider.
- Set event source parameters.
Figure 1 Kafka event source
Table 1 Parameter description Parameter
Description
Instance
Select a Kafka instance.
Topic
Select a topic.
Consumer Group
Enter a group name.
Concurrency
Enter the number of concurrent messages. Range: 1–1000.
This parameter is autofilled with the number of partitions for the selected topic. Recommended: retain this default number for better message retrieval.
Consumption Offset
Select a consumption offset.
- Latest: Consumption starts from the latest message in the queue.
- Earliest: Consumption starts from the earliest message in the queue.
SASL Mechanism
This parameter is available when SASL SSL authentication is enabled for the Kafka instance. Select an SASL authentication mechanism.
- PLAIN: a simple username and password verification mechanism.
- SCRAM-SHA-512: uses the hash algorithm to generate credentials for usernames and passwords to verify identities. SCRAM-SHA-512 is more secure than PLAIN.
SASL Certificate URL
This parameter is available when SASL SSL authentication is enabled for the Kafka instance. Enter an SASL certificate URL. For details about the URL, see How Do I Obtain the SASL Certificate Address of a DMS for Kafka Instance?
- The package must be in ZIP format. The number of files in the package cannot exceed two. The size of the package and file cannot exceed 1 MB.
- The certificate name must be fixed to client.jks.
SASL Certificate Key
This parameter is available when SASL SSL authentication is enabled for the Kafka instance. Enter an SASL certificate key.
Username
This parameter is available when SASL SSL authentication is enabled for the Kafka instance. Enter a username.
Password
This parameter is available when SASL SSL authentication is enabled for the Kafka instance. Enter a password.
- Click Save.
Configuring the Target
- Configure an event target.
- Click Event Target.
- Select Distributed Message Service (DMS) for Kafka for Target.
- Set event target parameters.
Figure 2 Distributed Message Service (DMS) for Kafka
Table 2 Distributed Message Service (DMS) for Kafka parameters Parameter
Description
Connection
Select a connection. If no connection is available, create one with DMS for Kafka.
Topic
First select a connection, and then select a topic.
Message Key
Disable
Message Key is not enabled.
Enable
Variable: The key is a variable value from CloudEvents-compliant events.
Constant: The key is a specified constant. All messages will be sent to the same partition.
Rule
Transform Type
Variables: data.value
For more information about transformation types, see Event Content Transformation.
Message Push
Batch Push
Specify whether to enable Batch Push to aggregate multiple events.
Messages
Interval (s)
The maximum number of aggregated records that can be pushed at a time. Default: 100. Range: 1–10,000. This parameter is available only when Batch Push is enabled.
The interval between batch pushes, in seconds. Default: 1. Range: 0–15. This parameter is available only when Batch Push is enabled.
Table 3 Batch push example Messages
Interval (s)
Effect
100
1s
100 messages pushed every second.
200
5s
500 messages pushed every 5 seconds.
- After the configuration is complete, click OK.
- Click Enable in the operation column of Event Streams. If the Status changes to Running, the link is successfully created.
Performing Verification
- Log in to the DMS for Kafka console and select the region where the Kafka instance is located.
- On thg DMS for Kafka page, click the Kafka instance name to go to the details page.
- Choose Message Query and query the Message Body of the source topic and target topic.
Figure 3 Target messageFigure 4 Source message
- Check whether the messages are consistent. If yes, data synchronization between the Kafka instances is successful.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot