In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article will explain in detail how to implement the Rocketmq message queue broadcast consumption test. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
One machine deployment
1. Machine composition
7 machines, all with 16 GB of memory
Each server has 4 CPU,2 cores
2. Running environment configuration
3. The way of brushing disk.
Each machine master machine adopts asynchronous brushing mode.
Second performance evaluation
1. Purpose of evaluation
Test the broadcast mode consumption on the client side.
2. Evaluation index
The server of different consumerGroup groups compares whether the message msgId is the same in the process of consuming the message.
3. Evaluation logic
On the consumer side, in the consumption scenario of broadcast mode, consumerGroup grouping is meaningless. All consumer sides can consume the same message. So you only need to compare whether the consumed message msgId is the same.
4. Evaluation process
(1) the producer sends a large number of messages to the topic queue named "orderTopicTest", which is set at 10 messages. After sending messages, the basic information such as msgId, queueId and topicId of each message is recorded.
(2) configure five different groups of consumerGroup with the names of DefaultCluster, DefaultCluster, DefaultCluster1, DefaultCluster2, DefaultCluster3 (the first group and the second group set the same consumerGroup name), subscribe to the same topic for each group, configure the same nameSrvAddr address, and configure the message mode on the client side to be broadcast mode.
The key code on the server side of setting the default DefaultCluster group is as follows:
The key code on the server side of setting the default DefaultCluster1 group is as follows:
(3) start five consumer clients first, and then start the producer side. After sending the message, you can view the consumption records of the message on all the consumer sides.
The first set of consumer consumption records are as follows:
The second set of consumer consumption records are as follows:
The third group of consumer consumption records are as follows:
The fourth group of consumer consumption records are as follows:
The fifth group of consumer consumption records are as follows:
(4) Analysis and comparison of message consumption
Both the first and second groups belong to the DefaultCluster group, except that the instanceName instance name is different.
The third, fourth, and fifth groups all belong to different Cluster groups, but the instanceName instance names are the same.
By analyzing the consumption records of the five groups, the consumption process of the same message is the same on all clients, including the order in which the message is consumed, the msgId of the message, and the queueId where the message is located.
Second, evaluation results
Rocketmq has the ability to consume broadcasts. All running consumer instances, regardless of which consumerGroup group the consumer belongs to, can consume the same message, and the order of messages consumed on all consumer ends, the queueId where the messages are located, and so on are the same.
This is the end of the article on "how to implement the Rocketmq message queue broadcast consumption test". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.