import json


def msg_key_to_string(msg):
    """Function to convert Kafka Message Key to a String

    :type msg: Kafka Message
    :param msg: The Kafka message

    :rtype: String
    :returns: The Kafka message key as a string

    """
    return json.loads(msg.key().decode('utf-8'))