Runtime.addShutdownHook() is the preferred way when using Java according to Lost message from the Kafka Topic.
Runtime.addShutdownHook()
How to do it when using python? What\'s the pr