def delivery_report(err, msg):
    """
    This is a utility method passed to the Kafka Producer to handle the delivery
    of messages sent using `send(topic, message)`.
    """
    if err is not None:
        print('message delivery failed: {}'.format(msg))
        print('failed message: {}'.format(err))
