def commit_message(consumer):
    """
    A convenience method to ensure messages are committed/handled synchronously.
    :param consumer: A confluent-kafka Consumer object
    :type consumer: confluent_kafka.Consumer or confluent_kafka.avro.AvroConsumer
    """
    consumer.commit(asynchronous=False)
