Why not use GlobalScope.launch?
You should scope your concurrency appropriately using structured concurrency. Your coroutines can leak if you don’t do this. In your case, scoping them to the processing of a single message seems appropriate. Here’s an example: /* I don’t know Kafka, but let’s pretend this function gets * called when you receive a new message */ … Read more