def serialize(message):
    serialized = json.dumps({'tags': message.tags, 'payload': message.payload}, sort_keys=True).encode('utf-8')
    return base64.b64encode(serialized)
def serialize(message):
    serialized = json.dumps({'tags': message.tags, 'payload': message.payload}, sort_keys=True).encode('utf-8')
    return base64.b64encode(serialized)