6

多实例下提升单分区单消费组速度

 3 years ago
source link: https://www.v2ex.com/t/789549
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  程序员

多实例下提升单分区单消费组速度

  Fu4ng · 1 天前 · 369 次点击
背景
外部团队给了一个 topic,这个 topic 只有一个分区,因为消息之间有强顺序关系。

问题
目前我们团队发现这个 topic 的消费速度有点慢,想优化下。

我自己想到了两种解决办法,感觉这两种方式都不太好。

解法 1
基于多单消费者的基础上,自己写个线程池,并发处理消息。
这个方法的缺点是只能有一个实例在消费消息(单消费者),无法扩展。

解法 2
引入 kafka, 把消息做一层转发,可以根据自己的业务逻辑做分区。
缺点是引入了一个中间件。


欢迎大佬们讨论

Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK