Example #1
0
    def setUp(self, conf=cfg.CONF):
        super(SkipIfNoTransportURL, self).setUp(conf=conf)

        self.rpc_url = os.environ.get('RPC_TRANSPORT_URL')
        self.notify_url = os.environ.get('NOTIFY_TRANSPORT_URL')

        if not (self.rpc_url or self.notify_url):
            self.skipTest("No transport url configured")

        transport_url = oslo_messaging.TransportURL.parse(
            conf, self.notify_url)

        kafka_options.register_opts(conf, transport_url)
Example #2
0
    def setUp(self, conf=cfg.CONF):
        super(SkipIfNoTransportURL, self).setUp(conf=conf)

        driver = os.environ.get("TRANSPORT_DRIVER")
        if driver:
            self.url = os.environ.get('PIFPAF_URL')
        else:
            self.url = os.environ.get('TRANSPORT_URL')

        if not self.url:
            self.skipTest("No transport url configured")

        transport_url = oslo_messaging.TransportURL.parse(conf, self.url)

        kafka_options.register_opts(conf, transport_url)
Example #3
0
    def setUp(self, conf=cfg.CONF):
        super(SkipIfNoTransportURL, self).setUp(conf=conf)

        driver = os.environ.get("TRANSPORT_DRIVER")
        if driver:
            self.url = os.environ.get('PIFPAF_URL')
            if driver == "pika" and self.url:
                self.url = self.url.replace("rabbit://", "pika://")
        else:
            self.url = os.environ.get('TRANSPORT_URL')

        if not self.url:
            self.skipTest("No transport url configured")

        transport_url = oslo_messaging.TransportURL.parse(conf, self.url)

        zmq_options.register_opts(conf, transport_url)

        zmq_matchmaker = os.environ.get('ZMQ_MATCHMAKER')
        if zmq_matchmaker:
            self.config(rpc_zmq_matchmaker=zmq_matchmaker,
                        group="oslo_messaging_zmq")
        zmq_ipc_dir = os.environ.get('ZMQ_IPC_DIR')
        if zmq_ipc_dir:
            self.config(group="oslo_messaging_zmq",
                        rpc_zmq_ipc_dir=zmq_ipc_dir)
        zmq_redis_port = os.environ.get('ZMQ_REDIS_PORT')
        if zmq_redis_port:
            self.config(port=zmq_redis_port,
                        check_timeout=10000,
                        wait_timeout=1000,
                        group="matchmaker_redis")
        zmq_use_pub_sub = os.environ.get('ZMQ_USE_PUB_SUB')
        zmq_use_router_proxy = os.environ.get('ZMQ_USE_ROUTER_PROXY')
        zmq_use_acks = os.environ.get('ZMQ_USE_ACKS')
        self.config(use_pub_sub=zmq_use_pub_sub,
                    use_router_proxy=zmq_use_router_proxy,
                    rpc_use_acks=zmq_use_acks,
                    group='oslo_messaging_zmq')
        zmq_use_dynamic_connections = \
            os.environ.get('ZMQ_USE_DYNAMIC_CONNECTIONS')
        self.config(use_dynamic_connections=zmq_use_dynamic_connections,
                    group='oslo_messaging_zmq')

        kafka_options.register_opts(conf, transport_url)

        self.config(producer_batch_size=0,
                    group='oslo_messaging_kafka')
Example #4
0
    def setUp(self, conf=cfg.CONF):
        super(SkipIfNoTransportURL, self).setUp(conf=conf)

        driver = os.environ.get("TRANSPORT_DRIVER")
        if driver:
            self.url = os.environ.get('PIFPAF_URL')
        else:
            self.url = os.environ.get('TRANSPORT_URL')

        if not self.url:
            self.skipTest("No transport url configured")

        transport_url = oslo_messaging.TransportURL.parse(conf, self.url)

        zmq_options.register_opts(conf, transport_url)

        zmq_matchmaker = os.environ.get('ZMQ_MATCHMAKER')
        if zmq_matchmaker:
            self.config(rpc_zmq_matchmaker=zmq_matchmaker,
                        group="oslo_messaging_zmq")
        zmq_ipc_dir = os.environ.get('ZMQ_IPC_DIR')
        if zmq_ipc_dir:
            self.config(group="oslo_messaging_zmq",
                        rpc_zmq_ipc_dir=zmq_ipc_dir)
        zmq_redis_port = os.environ.get('ZMQ_REDIS_PORT')
        if zmq_redis_port:
            self.config(port=zmq_redis_port,
                        check_timeout=10000,
                        wait_timeout=1000,
                        group="matchmaker_redis")
        zmq_use_pub_sub = os.environ.get('ZMQ_USE_PUB_SUB')
        zmq_use_router_proxy = os.environ.get('ZMQ_USE_ROUTER_PROXY')
        zmq_use_acks = os.environ.get('ZMQ_USE_ACKS')
        self.config(use_pub_sub=zmq_use_pub_sub,
                    use_router_proxy=zmq_use_router_proxy,
                    rpc_use_acks=zmq_use_acks,
                    group='oslo_messaging_zmq')
        zmq_use_dynamic_connections = \
            os.environ.get('ZMQ_USE_DYNAMIC_CONNECTIONS')
        self.config(use_dynamic_connections=zmq_use_dynamic_connections,
                    group='oslo_messaging_zmq')

        kafka_options.register_opts(conf, transport_url)

        self.config(producer_batch_size=0,
                    group='oslo_messaging_kafka')
Example #5
0
    def __init__(self, conf, url, default_exchange=None,
                 allowed_remote_exmods=None):
        conf = kafka_options.register_opts(conf, url)
        super(KafkaDriver, self).__init__(
            conf, url, default_exchange, allowed_remote_exmods)

        self.listeners = []
        self.virtual_host = url.virtual_host
        self.pconn = ProducerConnection(conf, url)
Example #6
0
    def __init__(self, conf, url, default_exchange=None,
                 allowed_remote_exmods=None):
        conf = kafka_options.register_opts(conf, url)
        super(KafkaDriver, self).__init__(
            conf, url, default_exchange, allowed_remote_exmods)

        self.listeners = []
        self.virtual_host = url.virtual_host
        self.pconn = ProducerConnection(conf, url)
    def __init__(self,
                 conf,
                 url,
                 default_exchange=None,
                 allowed_remote_exmods=None):
        conf = kafka_options.register_opts(conf, url)
        super(KafkaDriver, self).__init__(conf, url, default_exchange,
                                          allowed_remote_exmods)

        # the pool configuration properties
        max_size = self.conf.oslo_messaging_kafka.pool_size
        min_size = self.conf.oslo_messaging_kafka.conn_pool_min_size
        ttl = self.conf.oslo_messaging_kafka.conn_pool_ttl

        self.connection_pool = driver_pool.ConnectionPool(
            self.conf, max_size, min_size, ttl, self._url, Connection)
        self.listeners = []