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 realize State Management of broker server in RocketMQ

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article mainly introduces the RocketMQ broker server how to achieve state management, the article is very detailed, has a certain reference value, interested friends must read it!

Broker server manages the state of a broker on top of the storage layer and reads and writes messages by calling the interface of the storage layer DefaultMessageStore.

The core classes related to broker server are shown below:

1. ConsumerOffsetManager

Manage the progress of each consumer consumption

Public class ConsumerOffsetManager extends ConfigManager {private ConcurrentMap offsetTable = new ConcurrentHashMap; private void commitOffset (final String clientHost, final String key, final int queueId, final long offset) {ConcurrentMap map = this.offsetTable.get (key); if (null = = map) {map = new ConcurrentHashMap (32); map.put (queueId, offset); this.offsetTable.put (key, map) } else {Long storeOffset = map.put (queueId, offset); if (storeOffset! = null & & offset < storeOffset) {log.warn ("[NOTIFYME] update consumer offset less than store. ClientHost= {}, key= {}, queueId= {}, requestOffset= {}, storeOffset= {} ", clientHost, key, queueId, offset, storeOffset);}} / /.}

ConsumerOffsetManager periodically persists offsetTable to disk.

II. ConsumerManager

Manage all subscriber groups and maintain the following information for each consumer group:

Topic subscription method

Client channel for each consumer

Push or Pull consumption mode

Broadcast / cluster message model

III. ProducerManager

Maintain client channel and other information on the producer side

IV. SubscriptionGroupManager

Maintain subscription group information

5. TopicConfigManager

Maintain Topic information

These are all the contents of the article "how to achieve State Management in broker server in RocketMQ". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow 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

Internet Technology

Wechat

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

12
Report