Replies: 1 comment 4 replies
-
|
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
看了example例子,消费消息的步骤是:
1.先创建Consumer(rmq_client.NewSimpleConsumer),可以指定多个topic
2.调用Start
3.通过Receive 轮询topic获取消息,Receive方法中有个轮询的逻辑貌似没起到轮询的作用,代码如下:
上面这段代码中的topics 是map的key,是随机的,这里通过topicIndex 方式轮询的作用可能不生效
想问一下,一个NewSimpleConsumer下同时消费多个topic的情况下正确使用姿势是什么?如果只开启一个goroutine取轮询多个topic,有的topic的处理时间会很长(即使没有消息,也需要轮询),会影响其他topic的处理?
Beta Was this translation helpful? Give feedback.
All reactions