No description
AI Reading Assistant
Whole-book reading guide from stratified index samples; jump to passages in the text
AI guide
【One-Line Pitch】
A hands-on field guide to running Apache RocketMQ in production, pairing core concept explanations with real incident post-mortems from large-scale clusters. Best for backend engineers, SREs, and architects who already know messaging basics and now need to debug, tune, and operate RocketMQ under load.
【Book Arc】
- **Opening (~0%–10%)**: Frames the author's path into the RocketMQ community and lays out the mental model — core concepts, consumer groups, broadcast vs. clustering, offset storage, and why `autoCreateTopicEnable` is dangerous in production.
- **Early (~10%–30%)**: Gets you operational: local install, running NameServer/Broker in IDEA for source-level debugging, HA master-slave mechanics, and the read/write-splitting rules that decide whether consumers pull from master or slave.
- **Middle (~30%–60%)**: Moves into troubleshooting war stories — a console showing zero TPS while backlog drops, where a new consumer group starts consuming, JVM process exits, and the classic "topic expanded but some queues go unread" trap.
- **Late (~60%–90%)**: Deepens into the storage and network internals behind "system busy / broker busy" errors — PageCache pressure, `transientStorePoolEnable`, MappedFile write paths, and the Netty request-processor/thread-pool binding model.
- **Ending (~90%–100%)**: Consolidates operational judgment: how to read broker logs and metrics, when to suspect configuration vs. application, and how to reason from symptom to root cause. (Excerpts do not cover the final chapters in detail.)
【Key Takeaways】
- **Consumption semantics are a design decision, not a default** (Opening): broadcast vs. clustering, concurrent vs. ordered consumption, and per-group offset storage each carry different failure and retry behavior — ordered consumption retries forever, concurrent retries 16 times.
- **`autoCreateTopicEnable=true` is a production anti-pattern** (Opening): auto-created topics only land on the broker that first received the message, so routing can collapse to a single node and messages never reach other brokers.
- **HA is master-slave, not failover** (Early): the slave never takes over message sending; it only serves reads, and read/write splitting is governed by `slaveReadEnable`, backlog-vs-memory thresholds, and subscription-group broker hints.
- **Zero TPS with shrinking backlog is explainable, not a bug** (Middle): when backlog exceeds ~40% of physical memory, consumption shifts to the slave, so master-side TPS stats read zero while messages are still being consumed.
- **Where a new consumer group starts depends on `consumeFromWhere`** (Middle): `CONSUME_FROM_LAST_OFFSET` and friends resolve differently for retry topics vs. normal topics, and misreading this looks like a bug.
- **Queue expansion can silently strand queues** (Middle): after scaling a topic's queues, some queues may go unconsumed if subscription groups aren't created on all brokers — the fix is often configuration, not application code.
- **"system busy / broker busy" traces back to storage and threading** (Late): PageCache busy checks, `transientStorePoolEnable` direct-buffer locking, and bounded send thread-pool queues are the levers to inspect and tune.
- **Debugging method beats memorized fixes** (Middle/Late): the recurring lesson is to find the pattern by comparing broken vs. healthy consumers, form a hypothesis, then verify — not to restart blindly.
【Reading Tips】
- Deep-read the Opening concept chapter and the Early HA/read-write-splitting sections; these underpin every later troubleshooting story.
- Treat the Middle chapters as case studies: skim the code listings, but read the "problem analysis" and "answer" sections closely — that's where the transferable reasoning lives.
- For the storage/network chapters, focus on the configuration parameters (`transientStorePoolEnable`, `sendThreadPoolQueueCapacity`, `slaveReadEnable`) rather than line-by-line source.
- Keep a running list of "symptom → likely cause" pairs as you read; this book's value is diagnostic pattern-matching, not API reference.
- If you're new to RocketMQ, pair this with the author's earlier internals book; this one assumes familiarity with pull/consume flows.
【Coverage Limits】
This guide is synthesized from stratified excerpts covering roughly the first half of the book plus selected late-chapter material; later chapters and any appendices are not represented, so the Ending stage is inferred rather than fully described.
Page 9
的 issues,看能不能解决,从问题入手,快速融入该项目。 尝试谢谢单元测试用例,测试驱动开发,借此学习该框架。 后面的事情就是坚持不懈,朝着目标不断前进,中途可以放慢速度,但千万别放弃,因 为只有坚持,才能胜利,只要前进,就离目标更近。 参与开源,一个最基本的条件是拥有大量的连续时间,想要成为一个开源框架的...
View in text
Excerpt 2
ttp://localhost:8080 查看是否安装成功,如果出现如下图则表示安 装成功。 3. 异常分析与解决思路 如果在安装过程中出现意想不到的错误,别慌,通过查看相关的日志文件,寻找错误日 志,根据错误日志进行思考或百度,相信能够轻易将其解决。 例如使用的 baseuser 启动的 rocketmq,ro...
View in text
Excerpt 3
相关界面上的消费 TPS主要来自 examineConsumeStats 方法,该方法我就不再继续深入,我们只需找到 该方法向 broker 发送的请求编码,然后根据该请求编码找到 broker 的处理逻辑即可, 最后跟踪发送的请求编码为:RequestCode.GET_CONSUME_STATS。 GET_CO...
View in text
Excerpt 4
众号,仅作技术交流,未授权任何商业行为。 73 > 1.6 RocketMQ一个新的消费组初次启动时从何处开始消费呢? 代码@2:如果消息消费进度文件中存储该队列的消息进度,其返回的 offset 必然会大 于等于 0,则直接返回该偏移量该客户端,客户端从该偏移量开始消费。 代码@3:如果未从消息消费进度文件中查...
View in text
Excerpt 5
f queue: %d 其抛出源码的入口点:BrokerFastFailure#cleanExpiredRequest。该方法的调用 频率为每隔 10s 中执行一次,不过有一个执行条件,就是 Broker 端要开启快速失败,默 认为开启,可以通过参数 brokerFastFailureEnable 来设置。该方法...
View in text
Excerpt 6
Log=true storePathRootDir=/opt/application/rocketmq-all-4.5.2-bin-release/store/dledger_store dLegerGroup=broker-a dLegerPeers=n0-192.168.0.220:40911;n1-192....
View in text
Excerpt 7
producer.send(msg); System.out.printf("%s%n", sendResult); } catch (Exception e) { e.printStackTrace(); Thread.sleep(1000); } } producer.shutdown(); } static...
View in text
Excerpt 8
able 开启 transientStorePoolEnable 机制,即在 broker 中配置文件中增加如下配置: 本文来自『中间件兴趣圈』公众号,仅作技术交流,未授权任何商业行为。 扫一扫加入作者公众号 扫一扫关注 中间件兴趣圈 RocketMQ官微 扫一扫关注【阿里巴巴云原生】公众号 阿里云开发者“藏经阁...
View in text
Tags
AI categories
BackendBig DataSoftware
Text Preview (First 20 pages)
Registered users can read the full content for free
Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.
Generating text preview…
Loading comments...
Reply to Comment
Edit Comment