· 4 min read

HOW TO SETUP UROCKETMQ FOR DISTRIBUTED APPLICATION MESSAGING

RocketMQ is an open-source, distributed message-oriented middleware platform for reliable and scalable data streaming and messaging. If you are looking to setup RocketMQ in SCloud, our platform offers a ready and easy to use service called URocketMQ. Before we jump into how you can setup URocketMQ ...

RocketMQ is an open-source, distributed message-oriented middleware platform for reliable and scalable data streaming and messaging. If you are looking to setup RocketMQ in SCloud, our platform offers a ready and easy to use service called URocketMQ. Before we jump into how you can setup URocketMQ in the SCloud console, do know that deploying RocketMQ in the cloud offers a whole lot of benefits, including:

  • 1. Scalability

Cloud platforms allow you to easily scale your RocketMQ cluster up or down based on your messaging workload. You can add or remove resources as needed to accommodate changing demands.

  1. 2. High Availability

Cloud environments provide tools and services for achieving high availability and fault tolerance. You can distribute RocketMQ brokers across multiple availability zones to ensure system reliability.

  1. 3. Managed Services

Some cloud providers offer managed message queue services, which can simplify operational tasks like maintenance, patching, and monitoring. This can free your team from low-level infrastructure management.

  1. 4. Cost Efficiency

Cloud providers often offer pay-as-you-go pricing models, allowing you to pay only for the resources you use. This can be cost-effective for organizations, especially if they have fluctuating workloads.

  1. 5. Global Reach

Cloud providers have data centers in multiple regions around the world. This allows you to deploy RocketMQ clusters closer to your end-users, reducing latency and improving the user experience.

  1. 6. Security and Compliance

Cloud providers typically offer robust security features and compliance certifications, making it easier to meet regulatory requirements and protect your messaging data.

  1. 7. Integration with Other Cloud Services

Cloud platforms provide various services that can be integrated with RocketMQ, such as databases, machine learning, and analytics tools, facilitating end-to-end solutions.

  1. 8. Elasticity

You can use auto-scaling and load-balancing features provided by the cloud to dynamically adapt to changes in message throughput.

Here’s how to use SCloud Console to setup URocketMQ:

  1. 1. Create URocketMQ Instance:
  2. 1.1. Sign in to SCloud Console.
  3. 1.2. Select ‘All Products’ on the top left & click ‘URocketMQ’.

  1. 1.3. Click ‘Create Instance’.

  1. 1.4. Select your package version, TPS, Number of topics & storage you need. (For purpose of this tutorial only, we will use ‘Enterprise’ & the following values).

  1. 1.5. Configure your network settings, we will select it network in order to make it accessible externally.

  1. 1.6. Enter the Name for the RocketMQ you want. You can choose to group it or not.

  1. 1.7. Choose a payment plan and click ‘Purchase Now’. Your RocketMQ instance is now created and ready for further settings.

  1. 2. Create Topic & Message:
  2. 2.1. Click on the instance name to start creating topics.

  1. 2.2. Select ‘TopicManage’.

  1. 2.3. Enter a topic name (in our case, we will name it ‘TestTopic’, and use a normal message type).

  1. 2.4. Your topic is now created as shown. You can test it by clicking ‘Send Message’.

  1. 2.5. Enter message information as shown and click ‘OK’ once ready to send this message.

  1. 2.6. If the message is sent successfully, you will get a pop-up with the ‘Message ID’.

  1. 3. Check Message Details & Status:
  2. 3.1. Go to the ‘MessageQuery’ tab and click ‘Press Topic’. Choose your topic from the drop-down menu and click ‘Inquire’.

  1. 3.2. Now, the full list of messages sent in this topic will appear:

  1. 3.3. Select a particular message and click ‘Details’ to see the full message body.

  1. 3.4. You can use SDKs created by different programming languages to be used by your application. Example below (Note: Replace the topic, name_srv and keys with your own):
    • apache/rocketmq-client-cpp: Apache RocketMQ cpp client (github.com)
    • rocketmq-client-go/examples at v2.1.1-rc2 · apache/rocketmq-client-go (github.com)
    • apache/rocketmq-client-nodejs: Apache RocketMQ nodejs client (github.com)
    • rocketmq-client-python/samples/producer.py at master · apache/rocketmq-client-python (github.com)
  1. 3.5. You can get the keys from the ‘ACL’ tab as shown:

When using Apache RocketMQ in the cloud, you should follow best practices for setting up and configuring RocketMQ, ensuring that it aligns with your organization’s specific messaging and streaming data needs. For any enquiries, please email enquiry@scloud.sg.  

Read other tutorials:

Share: