这是否需要实现或已经在 channel 中?
如果我有一个有多个消费者订阅的 channel 组,并且发送了一个消费者消息是消息丢失给其他消费者,还是消息一直存在直到所有消费者都看到该消息?
或者无论消费者是否看到消息,消息都会持续一段时间直到时间到期?
最佳答案
Group
对象管理对所有消费者的传递(如果可能)和消息过期。但请注意,无法保证交付。
来自documentation :
Channels implements this abstraction as a core concept called Groups ...
[Groups] also automatically manage expiry of the group members - when the channel starts having messages expire on it due to non-consumption, we go in and remove it from all the groups it’s in as well ...
One thing channels do not do, however, is guarantee delivery. If you need certainty that tasks will complete, use a system designed for this with retries and persistence (e.g. Celery)
关于django channels redis 多个消费者在不同的时间收到消息吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47318314/