def handle_message(self, topic_partition, message):
    execution = message.value
    LOGGER.info("Handling message: '%s'", str(execution))
    try:
        (failed, outputs, start_time, end_time, total_seconds) = RequestsProcessor.process(execution)
        result = RequestsProcessor.build_result(execution, outputs, start_time, end_time, total_seconds)
        self.publish_to_result_topic(result, failed)
    except:
        LOGGER.exception('An error occurred while handling the execution')
        self.publish_to_dead_letter_queue_topic(execution)
    self.commit_current_message(topic_partition)
    LOGGER.info("Done handling message: '%s'", str(execution))
def handle_message(self, topic_partition, message):
    execution = message.value
    LOGGER.info("Handling message: '%s'", str(execution))
    try:
        (failed, outputs, start_time, end_time, total_seconds) = RequestsProcessor.process(execution)
        result = RequestsProcessor.build_result(execution, outputs, start_time, end_time, total_seconds)
        self.publish_to_result_topic(result, failed)
    except:
        LOGGER.exception('An error occurred while handling the execution')
        self.publish_to_dead_letter_queue_topic(execution)
    self.commit_current_message(topic_partition)
    LOGGER.info("Done handling message: '%s'", str(execution))