NewLife.RocketMQ icon indicating copy to clipboard operation
NewLife.RocketMQ copied to clipboard

Consume 无法触发 Stop 方法,停止消费

Open xyyipiantian opened this issue 10 months ago • 3 comments

Image

Image

start() 之后

` var i= 0; while(i<10){ Task.Delay(1000) i++; }

consumerUser.Stop();

` 这时候看到 consumerUser 的 Avtive = false 所以无法触发 继续 Stop() 方法里面的 停止业务StopSchedule(); 方法

xyyipiantian avatar Apr 03 '25 07:04 xyyipiantian

Image Start的最后一行就是赋值Active

nnhy avatar Apr 13 '25 14:04 nnhy

base.Start() 里面看到了 Active 赋值了,但是 在实际运行过程中,while 之后 再查看 consumerUser 的 Active 属性就是 false,这个属性能有个方法 手动赋值 也可以

xyyipiantian avatar Apr 22 '25 20:04 xyyipiantian

优化消费者Stop方法。https://github.com/NewLifeX/NewLife.RocketMQ/issues/95 · NewLifeX/NewLife.RocketMQ@a4287b3 https://github.com/NewLifeX/NewLife.RocketMQ/commit/a4287b3f8998c04b4bc35685d2cf3b15112c6d1e

nnhy avatar May 15 '25 14:05 nnhy