def on_message(self, unused_channel, basic_deliver, properties, body):
    self._channel.basic_ack(basic_deliver.delivery_tag)
try:
    self._dispatcher(bytes(body.decode('utf-8') + '\n', 'utf-8'))
except Exception as e:
    raise
How to implement a RabbitMQ consumer using Pyspark Streaming module?