Files
doc-exports/docs/dms_rocketmq/umn/hrm-ug-039.html
chenjunjie 6c66276520 RocketMQ UMN 20250911 version
Reviewed-by: Liudmila Denisova <ldenisov@noreply.gitea.eco.tsi-dev.otc-service.com>
Co-authored-by: chenjunjie <chenjunjie@huawei.com>
Co-committed-by: chenjunjie <chenjunjie@huawei.com>
2026-03-18 14:47:34 +00:00

14 KiB

Accessing RocketMQ on a Client (Without SSL)

This document describes how to access a RocketMQ instance with SSL disabled on the Linux CLI. When SSL is disabled, data is transmitted in plaintext between the client and the RocketMQ instance with high performance.

Prerequisites

  • A RocketMQ instance with PLAINTEXT or PERMISSIVE encryption has been created.
  • The network between the client and the RocketMQ instance has been established. For details about network requirements, see RocketMQ Network Connection Conditions.
  • You have obtained the RocketMQ instance connection address.
    The connection address can be obtained from Overview > Connection on the RocketMQ console.
    • If the client uses TCP, obtain Instance Address (Private Network) IPv4 or Instance Address (Public Network).
    • If the client uses gRPC, obtain gRPC Connection Address IPv4 or gRPC Connection Address (Public Network).
  • Security group rules have been configured.
  • A topic has been created. The topic name has been obtained and publish and subscribe permissions are granted.
  • Java Development Kit 1.8.111 or later has been installed on the client server, and related environment variables have been configured.
  • The client server must be able to access the Internet to download the sample software package.

Accessing the Instance with CLI

  1. Log in to the client server using SSH.
  2. Download the rocketmq-tutorial software package.

    wget https://dms-demo.obs.eu-de.otc.t-systems.com/rocketmq-tutorial.zip

  3. Decompress the rocketmq-tutorial package.

    unzip rocketmq-tutorial.zip

  4. (Optional) If ACL is enabled for the RocketMQ instance, authentication is required when you run the mqadmin command.

    Switch to the directory where the decompressed software package is stored and add the following content to the conf/tools.yml file:
    accessKey:*******
    secretKey:*******

    accessKey and secretKey are the username and secret key set on the Instance > Users page of the console. For details, see Creating a User.

  5. Go to the rocketmq-tutorial/bin directory.

    cd rocketmq-tutorial/bin

  6. Produce normal messages using the sample project.

    sh mqadmin sendMessage -n "${Connection address}" -t ${Topic name} -p "Message content"
    Table 1 Message production parameters

    Parameter

    Description

    Example Value

    Connection address

    Connection address of the RocketMQ instance, which is obtained from Prerequisites.

    11.xxx.xxx.89:8200;11.xxx.xxx.144:8200 (public connection addresses as an example, private port is 8100)

    Topic name

    Name of a topic created in the RocketMQ instance, which is obtained from Prerequisites.

    topic-test

    Message content

    The message content is custom.

    The maximum message size supported by RocketMQ is 4 MB. This limit cannot be modified.

    hello rocketmq

    Run the following command with the values obtained in Table 1 to produce a normal message:

    sh mqadmin sendMessage -n "11.xxx.xxx.89:8200;11.xxx.xxx.144:8200" -t topic-test -p "hello rocketmq"

    The message is produced when the information in the red box shown in the following figure is displayed.

  7. Consume normal messages using the sample project.

    sh mqadmin consumeMessage -n "${Connection addresses}" -t ${Topic name}

    Run the following command with the values obtained in Table 1 to consume normal messages:

    sh mqadmin consumeMessage -n "11.xxx.xxx.89:8200;11.xxx.xxx.144:8200" -t topic-test

    The message is consumed when the information in the red box shown in the following figure is displayed.

    To stop consuming messages, press Ctrl+C to exit.

  8. Create messages with traces using the sample project.

    sh mqadmin sendMessage -n "${Connection addresses}" -t ${Topic name} -p "Message content" -m true

    Run the following command with the values obtained in Table 1 to produce messages with traces:

    sh mqadmin sendMessage -n "11.xxx.xxx.89:8200;11.xxx.xxx.144:8200" -t topic-test -p "hello rocketmq" -m true

    The message is produced when the information in the red box shown in the following figure is displayed.

  9. Consume messages and send the message traces using the sample project.

    sh mqadmin consumeMessage -n "${Connection addresses}" -t ${Topic name} -m true

    Run the following command with the values obtained in Table 1 to consume messages with traces:

    sh mqadmin consumeMessage -n "11.xxx.xxx.89:8200;11.xxx.xxx.144:8200" -t topic-test -m true

    The message is consumed when the information in the red box shown in the following figure is displayed.

    To stop consuming messages, press Ctrl+C to exit.

<script language="JavaScript"> </script>