• Distributed Message Service

dms
  1. Help Center
  2. Distributed Message Service
  3. Developer Guide
  4. Preparing the Environment

Preparing the Environment

Helpful Links

NOTE:

To create a new project, use the downloaded SDK. For coding in the sample project, use the SDK included in the project.

Preparing Tools

Table 1 Preparing tools

Tool

Required Version

How to Obtain

Eclipse

3.6.0 or later

https://www.eclipse.org/downloads/

JDK

1.8.111 or later

https://www.oracle.com/technetwork/java/javase/downloads/index.html

Apache Maven

3.0.3 or later

http://maven.apache.org/download.cgi

Obtaining a Kafka Topic ID and Consumer Group ID

Before accessing DMS using the SDK, create a Kafka queue and consume group on the DMS console, and obtain the topic ID and consume group ID.

  1. Log in to the management console.
  2. Choose Service List > Application > Distributed Message Service to launch the DMS console.
  3. In the navigation pane, choose Queue Manager.
  4. On the Queue Manager page, click Create Queue.
  5. Specify queue parameters.

    Table 2 Parameter description

    Parameter

    Description

    Region

    Region in which the queue will be created.

    Queue Name

    Name of the queue you want to create. The name must be unique.

    When creating a queue, a default queue name is generated, which you can change if required. A queue name consists of 1 to 64 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed.

    The queue name cannot be modified after the queue is created.

    Queue Type

    Select Kafka.

    Queue Mode

    Select either High throughput or High reliability.

    Default value: High throughput.

    High throughput: All message replicas are flushed to disk asynchronously. Select this mode when high message delivery performance is required.

    High reliability: All message replicas are flushed to disk synchronously. Select this mode when high message delivery reliability is required.

    Message Retention Period (h)

    This parameter is available only for Kafka queues.

    The number of hours for which messages will be preserved in a Kafka queue. Messages older than that period will be deleted and cannot be retrieved.

    Value range: integers from 1 to 72.

    Default value: 72.

    Tag

    When creating a queue, you can add tags to identify the queue. You can classify and search for queues by tag.

    • Tags of the same queue cannot have the same key.
    • You can customize tags or use tags predefined by Tag Management Service (TMS).
    • You can add a maximum of 10 tag keys to a queue.

    Description (optional)

    The description consists of a maximum of 160 characters and cannot contain angle brackets (< and >).

    Figure 1 Creating a Kafka queue

  6. Click OK.
  7. Click the name of the queue. On the displayed queue details page, obtain the Kafka topic ID, as shown in Figure 2.

    Figure 2 Obtaining the Kafka topic ID

  8. Click Create Consumer Group.
  9. Enter a consumer group name.

    A default queue name is generated, which you can change if required. A consumer group name consists of 1 to 32 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed. Consumer group names must be unique within the same queue.

  10. Click OK. Obtain the ID of the consumer group in the consumer group list, as shown in Figure 3.

    Figure 3 Obtaining the consumer group ID

Obtaining a Project ID

When calling APIs, you need to specify project_id in API requests. Obtain a project ID by performing the following procedure:

  1. Log in to the management console.
  2. Click the username and choose My Credential from the drop-down list.
  3. On the My Credentials page, view project IDs in the project list.

    Figure 4 Obtaining the project ID

Obtaining an AK/SK

  1. Log in to the management console.
  2. Click the username and choose My Credential from the drop-down list.
  3. On the My Credentials page, click the Access Keys tab.
  4. Click Add Access Key.
  5. Enter the password for login.
  6. Enter the verification code sent to your mailbox or mobile phone.
  7. Click OK.

    NOTE:

    Keep the access key ID (AK)/secret access key (SK) file secure.

  8. Download the credentials.csv file containing your AK and SK to a local computer.

Obtaining Region and Endpoint Information

Obtain the region and endpoint from Regions and Endpoints.

Collecting Environment Information

Table 3 Required environment information

Category

Information

Example

ECS

EIP

x.x.x.x

Username

name

Password

password

DMS

Queue name

my-kafka-queue

Queue ID

4df89da6-ede4-4072-93e0-28dc6e866299

Queue type

Kafka

Kafka topic ID

k-bd67aaead60940d688b872c31bdc653b-4df89da6-ede4-4072-93e0-28dc6e866299

Consumer group name

my-consumer-group

Consumer group ID

g-7ec0caac-01fb-4f91-a4f2-0a9dd48f8af7

AK/SK

AK

VAODAIIJGPUAYTJRRL**

SK

ZHN49c6bpwDiQvPqKJ5CxutJxqc04Glt9xSzxY**

Project

Region

eu-de

Project name

eu-de

Project ID

bd67aaead60940d688b872c31bdc653b

Region and endpoint

Region

eu-de

Endpoint

dms-kafka.eu-de.otc.t-systems.com:37000

DNS

DNS server IP address

172.16.16.65