Python oslo_messaging.get_transport() Examples

The following are 6 code examples of oslo_messaging.get_transport(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module oslo_messaging , or try the search function .
Example #1
Source File: rpc.py    From vdi-broker with Apache License 2.0 6 votes vote down vote up
def _get_transport():
    return messaging.get_transport(cfg.CONF, CONF.messaging_transport_url,
                                   allowed_remote_exmods=ALLOWED_EXMODS) 
Example #2
Source File: client.py    From galaxia with Apache License 2.0 5 votes vote down vote up
def __init__(self, topic, host):
        try:
            transport = messaging.get_transport(cfg.CONF)
            target = messaging.Target(topic=topic, server=host)
            self.rpc_client = messaging.RPCClient(transport, target)
        except MessagingException as ex:
            raise ex 
Example #3
Source File: broker.py    From galaxia with Apache License 2.0 5 votes vote down vote up
def __init__(self, topic, host, handler):
        serializer = messaging.RequestContextSerializer(
                messaging.JsonPayloadSerializer())
        transport = messaging.get_transport(cfg.CONF)
        target = messaging.Target(topic=topic, server=host)
        self.rpc_server = messaging.get_rpc_server(transport, target, handler,
                                                   serializer=serializer) 
Example #4
Source File: server.py    From snippet with MIT License 5 votes vote down vote up
def test(self, ctx, arg):
        return arg


# `Transport` is the capsulation of the Message Queue, such as RabbitMQ.
# If no @url, it will use `CONF.transport_url`.
# The specification of `url` is "transport://user:pass@host1:port[,userN:passN@hostN:portN]/virtual_host"
#transport = oslo_messaging.get_transport(cfg.CONF, url="rabbit://me:passwd@host:5672/virtual_host") 
Example #5
Source File: __init__.py    From sgx-kms with Apache License 2.0 5 votes vote down vote up
def init(conf, is_server_side=True):
    global TRANSPORT, IS_SERVER_SIDE
    exmods = get_allowed_exmods()
    IS_SERVER_SIDE = is_server_side
    TRANSPORT = messaging.get_transport(conf, allowed_remote_exmods=exmods) 
Example #6
Source File: rpc.py    From coriolis with GNU Affero General Public License v3.0 5 votes vote down vote up
def _get_transport():
    return messaging.get_transport(cfg.CONF, CONF.messaging_transport_url,
                                   allowed_remote_exmods=ALLOWED_EXMODS)