import json


def Read_Message_Dict(BB, msg_name):
    """
    Read_Message_Dict(BB, msg_name):
    Reads the named BB message contents, json.loads it, and returns the resulting dict.
    Returns an empty dict if the message is not found or could not be read back.
    """
    try:
        msg_item = BB.ReadMessage(msg_name)
        msg_item = json.loads(msg_item)
        try:
            test = msg_item.keys()
        except:
            msg_item = {}
    except:
        msg_item = {}
    return msg_item