rocketmq-spring
rocketmq-spring copied to clipboard
v5 版本中如何让消息在同一个服务的多个实例中广播呢?
The issue tracker is ONLY used for bug report and feature request.
Any question or RocketMQ proposal please use our mailing lists.
FEATURE REQUEST
-
Please describe the feature you are requesting. 在 spring cloud 项目中启动多个实例,希望消息能在多个实例中广播消费
-
Provide any additional detail on your proposed use case for this feature. 项目中用到了 websocket 推送,然后借助消息队列实现消息转发
A Producer -> sendMessage -> RocketMQ -> A PushConsumer 接受 -> websocket 发送到页面
-> B PushConsumer 接受 -> websocket 发送到页面
A、B 为同一个服务的多个实例
我尝试按照文档使用多个 consumerGroup 但是会报错
使用的包为 rocketmq-v5-client-spring-boot-starter-2.2.4-SNAPSHOT
有没有大佬帮忙解答一下呢?
@liuweiGL
-
目前适配的sprintboot注解不太满足你的需求;
-
每个web socket连接都对应一个的Consumer, 有些浪费资源。 构建一个WebSocketManager,组合一个Consumer 实例(独立的Group), WebSocketManager管理N个web socket, 负责将consumer获取的消息fan-out。
-
每个你的业务节点Node,根据你的业务特点,包含1个或者多个WebSocketManager。