This document takes the example of creating a RocketMQ instance with SSL enabled and accessing it on a client in the same VPC as the instance over a private network for message production and consumption to get you quickly started with Distributed Message Service (DMS) for RocketMQ.
Figure 1 Procedure for using DMS for RocketMQ

A RocketMQ instance runs in a VPC. Before creating a RocketMQ instance, ensure that a VPC is available.
Enable SSL, disable ACL, and configure the created VPC and subnet, and security group.
After an instance is created, create a topic for sending and receiving messages.
On the client, connect to the instance and use commands to produce and consume messages.
The RocketMQ administrator permission DMS FullAccess is required. For details, see Creating an IAM User and Granting DMS for RocketMQ Permissions.
The VPC must be created in the same region as the RocketMQ instance.
A RocketMQ instance runs in a Virtual Private Cloud (VPC). Before creating an instance, ensure that a VPC is available. For details about how to create a VPC and a subnet, see "Creating a VPC" in Virtual Private Cloud User Guide.
See "Creating a Security Group" in Virtual Private Cloud User Guide.
To connect to RocketMQ instances, add the security group rules described in Table 1.
Direction | Protocol | Port | Source | Description |
|---|---|---|---|---|
Inbound | TCP | 8100 | IP address or IP address range of the RocketMQ client | The port is used for private network access to metadata nodes using TCP. |
Inbound | TCP | 10100–10199 | The port is used for accessing service nodes using TCP. |
After a security group is created, its default inbound rule allows communication among ECSs within the security group and its default outbound rule allows all outbound traffic. In this case, you can access a RocketMQ instance within a VPC, and do not need to add rules according to Table 1.
The following takes a Linux ECS as an example. For more information about how to install JDK and configure the environment variables for a Windows ECS, please search the Internet.
in the upper left corner, click Elastic Cloud Server under Computing, and then create an ECS.For details, see Creating an ECS. If you already have an available ECS, skip this step.
Use Oracle JDK instead of default ECS JDK (for example, OpenJDK), because it may not be suitable for the sample project. Obtain Oracle JDK 1.8.111 or later from Oracle's official website.
tar -zxvf jdk-8u321-linux-x64.tar.gz
Change jdk-8u321-linux-x64.tar.gz to your JDK version.
vim ~/.bash_profile
export JAVA_HOME=/opt/java/jdk1.8.0_321export PATH=$JAVA_HOME/bin:$PATH
Change /opt/java/jdk1.8.0_321 to the path where you install JDK.
:wq
source .bash_profile
java -version
If the following information is displayed, the JDK is installed successfully:
Before downloading the sample software package, ensure that the client server can access the Internet.
wget https://dms-demo.obs.ru-moscow-1.hc.sbercloud.ru/rocketmq-tutorial.zip
unzip rocketmq-tutorial.zip
Before using RocketMQ for message production and consumption, create a RocketMQ instance. The VM resource in the instance store topics.
Parameter | Description |
|---|---|
Billing Mode | Select the billing mode of the instance. Select Pay-per-use. You will be billed for your usage duration. The fees are calculated in seconds and settled by hour. |
Region | For lower network latency and faster access to your resources, select the nearest region. Select RU-Moscow. |
Project | Projects isolate compute, storage, and network resources across geographical regions. For each region, a preset project is available. Select RU-Moscow (default). |
AZ | Select one AZ or at least three AZs. |
Instance Name | Enter the instance name, for example, rocketmq-test. |
Enterprise Project | An enterprise project manages project resources in groups. Enterprise projects are logically isolated. Select "default". This parameter is for enterprise users. |
Version | Select an instance version. Select 4.8.0. Fixed once the RocketMQ instance is created. Use the same version as your client. |
Architecture | Select an instance architecture. Select Cluster here. |
Broker Flavor | Select an instance flavor. Select rocketmq.4u8g.cluster here. |
Brokers | Specify the instance broker quantity. Enter 1 here. |
Storage Space per Broker | Specify the disk type and storage space per broker for storing RocketMQ data. Select Ultra-high I/O and enter 300. Total storage space of an instance = Storage space per broker × Number of brokers |
VPC | Select a VPC and a subnet. Here, select the ones created in Step 1: Preparations. |
Security Group | Select the security group. Here, select the one created in Step 1: Preparations. |
SSL | Ciphertext access with high security, but lower performance. Select SSL. |
ACL | Enabling ACL can manage permissions for message production and consumption. Do not enable it here. |
More Settings | |
Public Access | EIPs are required to enable public access. Do not enable it here. |
Tags | Identifiers of the RocketMQ instance. Skip it here. |
Description | Additional information about the instance. Skip it. |
It takes 3 to 15 minutes to create an instance. During this period, the instance status is Creating.
The RocketMQ instance connection address displays the domain name by default. Hover over the domain name and record the IP address displayed in the floating box.
A topic is the basic unit for sending and receiving messages. After creating a RocketMQ instance, you must manually create topics before creating and retrieving messages.
Parameter | Description |
|---|---|
Topic Name | Enter a topic name. Enter Topic01 here. |
Permission | Permission of the topic. Select Publish/Subscribe here. Producers can publish messages to this topic and consumers can consume the messages from this topic. |
Brokers | Associated brokers. Select broker-0 here and enter 3 queues. |
Description | Additional information about the topic. Skip it. |
cd rocketmq-tutorial/bin
The following is a command example:

The following is a command example:

The content of BODY is the consumed message content.
To stop consuming messages, press Ctrl+C to exit.