Getting Started with DMS
-
Distributed Message Service (DMS) is a message middleware service based on the distributed, high-availability clustering technology. It provides reliable, scalable, and fully managed queues for creating, retrieving, and storing messages.
-
On the DMS console, you can create queues, consumer groups, and messages and retrieve messages with just a few clicks, without worrying about O&M.
-
This guide uses the Kafka queue as an example to help you get started with DMS.
Step 1: Preparing the Environment
1. Log in to the management console. Choose Computing > Elastic Cloud Server to launch the ECS console. On the ECS console, create an ECS (preferably from a Windows image).
2. Download and install the following development tools on the ECS: Eclipse3.6.0 or later JDK1.8.111 or later.
Note
1. The ECS must be bound with an elastic IP address. Otherwise, the ECS cannot download Eclipse or JDK from the Internet.
2. If you have already created an ECS, you can skip step 1.
1
Buy an ECS.
2
Configure an image.
3
Configure an EIP.
View Image
Step 2: Creating a Kafka Queue
1. Choose Application > Distributed Message Service from the management console. Click Create Queue in the upper-right corner of the DMS console.
2. Enter a queue name, select Kafka as the queue type, and select a queue mode. Click OK to create the queue.
Note
1. The displayed region must be the same as the region in which you will use DMS. To select a different region, use the region selector in the main menu bar.
1
Create a queue.
2
Configure the queue.
View Image
Step 3: Creating a Consumer Group
1. Click the name of the Kafka queue to show more details of the queue.
2. On the queue details page, click Create Consumer Group. In the Create Consumer Group dialog box, enter a consumer group name.
Note
1. The Kafka topic ID is displayed in the Basic Information area of the queue details page, and the consumer group ID is displayed on the Consumer Group tab of this page. Kafka topic IDs and consumer group IDs are used respectively to identify Kafka queues and consumer groups during message creation and retrieval.
2. By default, a maximum of three consumer groups can be created in each queue. With queues and consumer groups, system components can communicate with each other even if they are not always available.
1
Create a consumer group.
2
View the queue details.
View Image
Step 4: Obtaining IAM Authentication Information
1. Click your username in the upper-right corner of the management console, and choose My Credential.
2. On the My Credential page, obtain the project ID and Access Key ID/Secret Access Key (AK/SK) used for configuring the demo Kafka project.
Note
1. To ensure security of queues and messages, DMS uses HUAWEI CLOUD IAM service for identity authentication.
2. If you have already obtained an AK/SK, skip the procedure "Obtaining IAM Authentication Information".
1
Choose My Credential.
2
Obtain the Project ID and Access Key.
View Image
Step 5: Setting Up the Project Environment
1. Log in to the ECS, and download the Demo package.
2. Select Exiting Projects Into Workspace to import the demo project.
3. Replace the obtained Queue Topic, Consumer Group ID, Project ID, and AK/SK into the configuration file. Parameter configuration guide
Note
1. The project contains the DMS Kafka SDK file and demo code.
1
Import a project.
View Image
Step 6: Compiling and Managing Queues
1. Build the project manually or automatically.
2. Run the DMSKafkaProducerDemoto create messages.
3. Run the DMSKafkaconsumerDemoto retrieve messages from the consumer group.
Note
1. On the management console, you can view the change of the number of messages in queues and consumer groups.
2. If the demo project can create and retrieve messages successfully, it indicates that the queue, consumer group, and local environment are correctly configured. You can use DMS by referring to the demo project.
1
Build the project.
2
Create messages.
2
Retrieve messages.
View Image
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot