Files
doc-exports/docs/dms/umn/kafka_ug_0024.html
chenjunjie 190f09501c DMS UMN 20250314 version
Reviewed-by: Liudmila Denisova <ldenisov@noreply.gitea.eco.tsi-dev.otc-service.com>
Co-authored-by: chenjunjie <chenjunjie@huawei.com>
Co-committed-by: chenjunjie <chenjunjie@huawei.com>
2025-10-06 09:50:17 +00:00

2.5 KiB

Viewing Sample Code of Kafka Production and Consumption

Distributed Message Service allows you to view sample Java, Go, and Python code of producing and consuming messages on the console. You can quickly complete Kafka client integration.

Procedure

  1. Log in to the console.
  2. Click in the upper left corner to select the region where your instance is located.
  3. Click Service List and choose Application > Distributed Message Service. The Kafka instance list is displayed.
  4. Click the desired instance to go to the instance details page.
  5. In the navigation pane, choose Topics.
  6. Click View Sample Code. The Sample Code dialog box is displayed.

    The sample code is available in Java, Go, and Python, and PlainText, SASL_SSL, and SASL_PLAINTEXT access modes.

    • PlainText: Accessing the Kafka instance in plaintext.
    • SASL_SSL: Accessing the Kafka instance in ciphertext with SASL authentication. SASL authentication uses PLAIN or SCRAM-SHA-512.
    • SASL_PLAINTEXT: Accessing the Kafka instance in plaintext with SASL authentication. SASL authentication uses PLAIN or SCRAM-SHA-512.