def mq_escape(chars):
    """
    Given a string that you might want to use in a RabbitMQ routing key, replace
    any dots, stars, or hashes with underscores, so it won't throw off Rabbit's
    bindings.
    """
    return chars.replace('*', '_').replace('.', '_').replace('#', '_')
