Closed leoliew closed 6 years ago
我也遇到同样的问题,求解。
@wilderchen 现在用上生产环境了么
刚决定弃用。
订阅完了,就消费了
consumer.subscribe('you-topic', '*', function*(msg) {
// 这里放你的消费逻辑,这里不报错就认为消费完了
});
@wilderchen 现在阿里内部也是用的这个模块,只是不需要鉴权
我猜他问的就是 .done() 的问题
对,没有 done的方法,现在转用 rabbitmq 了 ,文档比较全
如果要对node的用户商业化,建议提供比较完善的文档资料
@gxcsoccer
场景:
consumer 启动,发送 topicA + tagA,能收到消息
consumer.subscribe('topicA', 'tagA', function * (msg) {
...
})
consumer 停掉,发送 topicA + tagA,启动 consumer 也能收到消息
consumer.subscribe('topicA', 'tagA', function * (msg) {
...
})
consumer 停掉,发送 topicA + tagA,启动 consumer(如下:topicA + tagB) 收不到消息,符合预期
consumer.subscribe('topicA', 'tagB', function * (msg) {
...
})
改回 tagA 启动,收不到消息,改成 * 也收不到
consumer.subscribe('topicA', 'tagA', function * (msg) {
...
})
consumer.subscribe('topicA', '*', function * (msg) {
...
})
什么原理??
对,没有 done的方法,现在转用 rabbitmq 了 ,文档比较全
@leoliew done 的问题参考这里的的讨论 https://github.com/eggjs/egg/issues/1468
看example 只看到订阅消息,没看到如何消费