Updated on 2023-07-12 GMT+08:00

Viewing Sample Code

On the console, view sample code for creating and retrieving messages in Java, Go, and Python.

Procedure

  1. Log in to the management console.
  2. Click in the upper left corner to select a region.

    Select the region where your Kafka instance is located.

  3. Click and choose Application > Distributed Message Service (for Kafka) to open the console of DMS for Kafka.
  4. Click the desired Kafka instance to view the instance details.
  5. Click the Topics tab.
  6. Click View Sample Code. The Sample Code dialog box is displayed.

    View sample code for creating and retrieving messages in Java, Go, and Python. Set Access By to PlainText to view the sample code where SASL_SSL authentication is disabled. Set Access By to SASL_SSL to view the sample code where SASL_SSL authentication is enabled.