Help Center/ EventGrid/ User Guide/ Event Streams/ Serverless Event Streams/ Event Source/ Distributed Message Service (DMS) for Kafka
Updated on 2025-08-07 GMT+08:00

Distributed Message Service (DMS) for Kafka

Configure a DMS for Kafka instance as the source of an event stream.

Prerequisites

  1. You have purchased a Kafka instance on the DMS for Kafka console. For details, see Buying a Kafka Instance.
  2. The security group of the Kafka instance allows access from the subnet and port of the Kafka instance in the inbound rules. For details, see Viewing the Subnet CIDR Block,Kafka Instance Port, and Adding a Security Group Rule.

Procedure

  1. Log in to the EG console.
  2. In the navigation pane, choose Event Streams > Serverless Event Streams.
  3. Click Create Serverless Event Stream, click the icon in the upper left corner, enter 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.
      Table 1 Kafka parameters

      Parameter

      Description

      Instance

      Select a Kafka instance.

      Access Mode

      Select Ciphertext Access or Plaintext Access.

      Security Protocol

      If you select Ciphertext Access for Access Mode, the corresponding security protocol will be displayed.

      Topic

      Select a topic.

      Consumer Group

      Enter a consumer group name containing 3 to 64 characters.

      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.

      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.
      • If the SASL certificate is modified, perform either of the following operations to ensure that the certificate takes effect:
        1. If the SASL certificate file name is changed, obtain the certificate address again, enter the address, and click Save.
        2. If the file name remains the same but one of the parameter Topic, Consumer Group, SASL Mechanism, SASL Certificate Key, Username, or Password is modified, click Save to reload the certificate.

      SASL Certificate Key

      This parameter is available when SASL_SSL authentication is enabled for the Kafka instance. Enter an SASL certificate key. The SASL certificate key is dms@kafka, which is obtained from the Kafka instance details page.

      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.
  6. Configure an event target by referring to Routing to FunctionGraph.
  7. After the event source and target are configured, click Save in the upper right.

    If sending events to the target fails, the whole batch of events will be retried until the processing is successful or the source message expires. The target must be able to process duplicate events.