'What happens to unprocessed messages in go channel on abrupt shutdown?

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?



Solution 1:[1]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Miko?aj G?odziak