import json


def serializer(message):
    """
    Serializer used on outgoing dictionary to Kafka.

    This converts the outgoing dictionary message to a json bytearray with utf-8
    format. This can then be sent to the topic.

    message : dict
        The message to be sent.
    """
    return bytearray(json.dumps(message),'utf-8')