Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build a local IDEA development and debugging environment for RocketMQ

2025-03-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Today, I would like to share with you how to build RocketMQ in the local IDEA development and debugging environment related knowledge points, detailed content, clear logic, I believe that most people still know too much about this knowledge, so share this article for your reference, I hope you can learn something after reading this article, let's take a look at it.

Preface

It is found that the message middleware on this side of the company uses aliyun's RocketMQ service. As students familiar with open source know, RocketMQ is the first batch of projects in China to donate Apache and graduate successfully. The architecture design refers to the pattern of kafka, so if you understand the architecture of kafka, you can be familiar with RocketMQ. Although you refer to kafka, RocketMQ also has many upgrades, such as Broker registration and discovery using internal NameServer, without introducing more third-party dependencies, and adding features such as message backtracking, transaction messages, delayed messages and so on. Since I haven't been exposed to RocketMQ (kafka and RabbitMQ, which I've been using before), I'm going to do some research and prepare for the later integration of spring boot metrics monitoring RocketMQ client information. The best way to study an open source project is Debug, so record the process of building a debugging environment for RocketMq locally

Generate installation package

Project address: https://github.com/apache/rocketmq, after downloading the project from this address, import it to the IDEA development tool, execute mvn install, and generate the installation RocketMQ package. After the generation is successful, under the distribution module, there will be the following directory, which will be used later.

Start NameServer

Find the namesrv module and run the main method of NamesrvStartup. At this time, you will be prompted that you need to set ROCKETMQ_HOME. The message is as follows:

At this point, you need the directory generated in the first step.

Copy / Users/kl/githubnamespace/rocketmq/distribution/target/rocketmq-4.7.1/rocketmq-4.7.1 directory

In the running settings page of IDEA, add the following parameters:

-Drocketmq.home.dir=/Users/kl/githubnamespace/rocketmq/distribution/target/rocketmq-4.7.1/rocketmq-4.7.1

Such as:

Then after starting it, you can start it successfully.

Start broker

Refer to the mode of starting NameServer, find the borker module, set the ROCKETMQ_HOME, use the-D method in the same way, and configure the address of the NameServer, such as:

-Drocketmq.namesrv.addr=127.0.0.1:9876

Then start it, and a complete single-node RocketMQ service running in IDEA is set up.

Install RocketMQ Console

In order to better observe the functions of RocketMQ, you can install a web management console, which requires another project

After the installation is successful, you can query the message information sent by producer through the web page, open the browser, and enter: http://localhost:8080. You can see the following page:

DEBUG heartily

When everything is ready, you can find the example module of the project, which has built-in use cases of various features and functions, and then you can Runing and Deubg as much as you want.

These are all the contents of this article entitled "how to build a local IDEA development and debugging environment for RocketMQ". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report