• Distributed Message Service

  1. Help Center
  2. Distributed Message Service
  3. Developer Guide
  4. Creating a Project

Creating a Project

This section uses the Maven project kafkademo as an example to describe how to create a project.


  1. Download the demo package.

    1. Log in to the DMS console.
    2. In the navigation pane, choose Using APIs.
    3. Choose Kafka Basic.
    4. Click Download Sample Code to download the demo package KafkaDemo.zip.

  2. Click Download SDK to download the DMS Kafka SASL package.

    Decompress the following directories from the package:

    • client.truststore.jks: client certificate
    • dms.kafka.sasl.client-1.0.0.jar: DMS Kafka SASL package
    • dms_kafka_client_jaas.conf: client configuration file

    You can also decompress the SDK package from KafkaDemo.zip (the location is KafkaDemo\dist\libs\dms.kafka.sasl.client-1.0.0.jar).

  3. On Eclipse (the recommended version is 4.6 or later), create a Maven project. The project name kafkademo is used as an example.

    Figure 1 Creating a Maven project

  4. Click Finish.
  5. Import the DMS Kafka SASL package dms.kafka.sasl.client-1.0.0.jar.

    1. Right-click the new project kafkademo, and create a libs folder.
    2. Copy dms.kafka.sasl.client-1.0.0.jar to libs.
    3. Add the following information to the pom.xml file to import dms.kafka.sasl.client-1.0.0.jar into the Maven repository:
    4. Save the pom.xml file.