All Products
Search
Document Center

ApsaraDB for OceanBase:Create a RocketMQ data source

Last Updated:Jun 13, 2023

Before you create a data migration or synchronization project, you must configure the data sources. This topic describes how to create a RocketMQ data source by using the data transmission service.

Prerequisites

Limitations

  • The data transmission service supports RocketMQ instances of V4.x and V5.x, including commercial and community editions.

  • For a self-managed RocketMQ instance in a virtual private cloud (VPC), add the CIDR block of the corresponding VPC to the security group of the Elastic Compute Service (ECS) instance where the RocketMQ instance is to be installed, and enable all ports of the namesvr and broker of the RocketMQ instance.

Procedure

  1. Log on to the ApsaraDB for OceanBase console.

  2. In the left-side navigation pane, choose Data Transmission > Data Source Management.

  3. On the Data Sources page, click Create Data Source in the upper-right corner.

  4. In the New Data Source dialog box, select RocketMQ for Data Source Type.

  5. Specify the following parameters. Select an instance type from the Instance Type drop-down list. The corresponding configuration section automatically appears.

    Instance type

    Parameter

    Description

    Alibaba Cloud RocketMQ instance

    Instances

    The data source. You can select an Alibaba Cloud RocketMQ instance from the drop-down list.

    Self-managed RocketMQ instance in VPC

    VPC

    Select the unique ID of the VPC that you applied for from the drop-down list.

    vSwitch

    A vSwitch is a basic network module of a VPC and is used to connect cloud resource instances. For more information, see Overview.

    Common parameters

    All common parameters in a RocketMQ instance in public network

    Data Source Identifier

    The name of the data source. We recommend that you set it to a combination of digits and letters. It must not contain any spaces and cannot exceed 32 characters in length.

    RocketMQ Endpoint Information

    The endpoint of the RocketMQ instance. The value is in the format of <IP address>:port number or <domain name>:port number.

    AccessKey

    Optional. The AccessKey ID that you created in the RAM console for identity authentication.

    You can hover over the user avatar in the upper right corner of the page and click AccessKey Management to view the AccessKey ID.

    SecretKey

    Optional. The AccessKey secret that you created in the RAM console for identity authentication.

    The AccessKey secret is displayed only once when you first create it. You cannot retrieve the AccessKey secret if you forget it. We recommend that you save the AccessKey secret for subsequent use. For more information, see Create an AccessKey pair.

    Remarks (Optional)

    Additional information about the data source.

  6. Click Test Connection to test the network connection between the data transmission system and the source database.

  7. After the test is passed, click OK.

Create a group

Before creating a RocketMQ data source, you need to create defaultGroup in advance. Otherwise, the test connection fails.

Alibaba Cloud RocketMQ instance

  1. Go to the details page of the RocketMQ instance.

    1. Log on to the Message Queue for Apache RocketMQ console.

    2. In the left-side navigation pane, click Instances.

    3. In the instance list, click the name of the target instance. The Instances page appears.

  2. In the left-side navigation pane, click Groups.

  3. On the Groups page, click Create Group and set the parameters.

    The parameters vary with the version of the RocketMQ instance. For more information, see Manage groups.

    Important

    When you create a group, the group ID must be set to defaultGroup.

  4. After you set the parameters, click OK.

  5. Create a topic named oms_test_topic.

    1. On the instance details page, click Topics in the left-side navigation pane.

    2. On the Topics page, click Create Topic.

    3. In the Create Topic dialog box, specify the parameters.

      Parameter

      Description

      Name

      Set this parameter to oms_test_topic.

      Billing Method

      This parameter is available only for RocketMQ instances of V4.x, and supports Pay-as-you-go only.

      Message Type

      • RocketMQ instances of V4.x support Normal Message, Transactional Message, Partitionally Ordered Message, Globally Ordered Message and Scheduled/Delayed Message.

      • RocketMQ instances of V5.x support Normal Message, Ordered Message, Scheduled/Delayed Message, and Transactional Message.

      Description

      It can contain a maximum of 128 characters.

    4. After you set the parameters, click OK.

Self-managed RocketMQ instance in VPC

Note

Perform the following steps to create a group and topic for a self-managed RocketMQ instance in a VPC, no matter whether the instance is of the commercial or community edition:

  1. Go to the RocketMQ directory on the machine and run the following command to create defaultGroup:

    ./bin/mqadmin updateSubGroup -n 10.10.10.1:2882 -c DefaultCluster -g defaultGroup
  2. Run the following command to create a topic named oms_test_topic:

    ./bin/mqadmin updateTopic -t oms_test_topic -n 10.10.10.1:2882 -c DefaultCluster