我们的服务利用 Kafka 发布和消费消息。我们使用蓝绿部署策略部署我们的服务。考虑以下场景:
- Suppose we have App1.0 service in Blue(which is live and taking traffic) currently ,consuming from topic,
- when we start deploying a new version App1.1, it will get deployed to Green first,so now
Green has : App1.1 (not consuming)
Blue has : App1.0 (consuming messages)
- once we switch green to blue , Blue has App1.1 , and green has App1.0.
我们这里的问题是,一旦切换发生,我们的绿色 pod(其中我们有旧代码 App1.0)仍在使用来自该 kafka 主题的消息。理想情况下,绿色 pod 现在应该停止从主题中消费。我们正在寻找一种解决方案,当我们部署时,我们的绿色 pod 应该停止消耗。