How to create a kafka consumer independent of Django server
bind the signals:
signal.signal(signal.SIGTERM, signal_handler)
signal.signal(signal.SIGINT, signal_handler)
and use try-except blok and you can do a clean up afterwards.
to make consumer more independend, you can use django-celery-beat
I am fairly new to Python. I have a django based web application where I am performing some tasks using Kafka. 
I am using confluent-kafka wrapper to communicate with the Kafka Broker.
So once a topic is created on the kafka broker, I assign a consumer to subscribe to this process, to make this non-blocking, I am using multiprocessing module so that the consumer runs on a separate thread and not block the main application thread.
However, I am not sure, what will happen if my server shuts down? Will the process still run like how the cronjobs still run even if the server is not running?
If not can someone please suggest me how should I trigger my consumer so that it is independent of my django server?