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

145 views Asked by At

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

There are 1 answers

0
Mikołaj Głodziak On

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.