Updated on 2025-08-07 GMT+08:00

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

  1. Log in to the EG console.
  2. In the navigation pane, choose Event Streams > Serverless Event Streams. Click Create Serverless Event Stream.
  3. Click in the upper left corner to configure the event stream name and description, and click OK.
  4. Configure a Kafka event source.

    1. Click Event Source.
    2. Select Distributed Message Service (DMS) for Kafka for Event Provider.
    3. 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.

  5. Click Save.

Configuring the Target

  1. Configure an event target.

    1. Click Event Target.
    2. Select Distributed Message Service (DMS) for Kafka for Target.
    3. 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.

  2. After the configuration is complete, click OK.
  3. Click Enable in the operation column of Event Streams. If the Status changes to Running, the link is successfully created.

Performing Verification

  1. Log in to the DMS for Kafka console and select the region where the Kafka instance is located.
  2. On thg DMS for Kafka page, click the Kafka instance name to go to the details page.
  3. Choose Message Query and query the Message Body of the source topic and target topic.

    Figure 3 Target message
    Figure 4 Source message

  4. Check whether the messages are consistent. If yes, data synchronization between the Kafka instances is successful.