这是我参与「第五届青训营 」伴学笔记创作活动的第 37 天 本节课将重点介绍 ByteFaaS 的 MQ 触发器,对 MQ 消费场景核心优化、常见的最佳实践以及故障排查方法等进行深入讲解,分享公司当前在应对不同场景时,如何真正做到让业务研发专心业务和消息处理,快速实现业务迭代。
MQ Basic Conceptions 101
- A message queue is a form of asynchronous service-to-service communication used in serverless and microservices architectures.
BMQ/Kafka RocketMQ NSQ (Deprecated)

BMQ: 兼容Kafka协议的MQ
- A consumer group is a group of consumers that share the same group id. When a topic is consumed by consumers in the same group, every record will be delivered to only one consumer.

- What is partition?
A single topic can consist of multiple internal queues, named partitions, which hold the records published to MQ.

- what is rebalance -> partition assignment is rebalance
MQ Trigger Handbook
Create & Use


Other Triggers Based on MQ Triggers
TOS触发器
Abase Binlog触发器

MQ Trigger Design And Core Optimizations
MQ Trigger Design

解耦:扩缩容方便!!!

Improve MQ Throughput for One Single Partition
Multi Threads Consuming Of One Partition


Distributed Limiting with Minor Performance Impact
Distributed QPS Limit(v1)

消费不均匀可能会导致问题
Distributed QPS Limit(v2 ongoing)

Avoid Stopping the World when MQ Rebalancing
BMQ/Kafka Rebalance - Static Membership

滚动升级,数据堆积能够降低非常多昂!!!非常好的优化!!!

One Click to Create a MQ Consumer
One Click to Request Permission & Resetting Offset

Control the Concurrency Automatically
Concurrency Control & Backoff


Reduce Unnecessary Msg Handling?
Plugin Filter

MQ Trigger Ops Practice
Auto Diagnosis

MQ Trigger Coming Features
- Limiter V2
- RPC Handler
- Orderly consuming in BMQ
- Better & better performance (http performance improve & co-locate)
- ......