英文:
What happens to unprocessed messages in go channel on abrupt shutdown?
问题
如果我使用 HPA(水平自动伸缩)或者由于 panic 而缩减副本数量,会发生什么情况呢?我的应用程序在 Kubernetes 中部署了一个 Go 应用程序。我的应用程序有一个 Go 协程,不断监听来自 Kafka 主题的消息,并将新消息推送到 Go 通道中进行进一步处理并提交 Kafka 消息。那么,如果我缩减副本数量,还有一些未处理的消息在 Go 通道中,会发生什么情况呢?
英文:
I have deployed a go application in kubernetes. My application has a go routine which continuously listens for messages from a kafka topic and push new messages into a go channel for further processing and commits kafka message. If I scale down the number of replicas using hpa/if replica goes down due to panic, what happens to the messages which are still in go channel unprocessed?
答案1
得分: 1
未处理的消息会发生什么呢?
Go语言中的通道是存在内存中的,所以当应用程序崩溃时,通道中的所有内容都会丢失。
英文:
>what happens to the messages which are still in go channel unprocessed?
The channels in go are in the memory, so when the app crashes, everything in the channels will be lost.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论