Add zmq-receiver
This is the ZeroMQ server which acts as a proxy for all messages destined to a particular host. Again, there are a bunch of FIXMEs here. This still needs work. Change-Id: I9384f486e44b0b0cbca028e219ad66f1990d5181
This commit is contained in:
parent
5d3fc9c18c
commit
a2d113198c
14
oslo/messaging/_cmd/__init__.py
Normal file
14
oslo/messaging/_cmd/__init__.py
Normal file
@ -0,0 +1,14 @@
|
||||
|
||||
# Copyright 2013 Red Hat, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
41
oslo/messaging/_cmd/zmq_receiver.py
Executable file
41
oslo/messaging/_cmd/zmq_receiver.py
Executable file
@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env python
|
||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
|
||||
# Copyright 2011 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import eventlet
|
||||
eventlet.monkey_patch()
|
||||
|
||||
import contextlib
|
||||
import logging
|
||||
import sys
|
||||
|
||||
from oslo.config import cfg
|
||||
|
||||
from oslo.messaging._drivers import impl_zmq
|
||||
from oslo.messaging._executors import impl_eventlet # FIXME(markmc)
|
||||
|
||||
CONF = cfg.CONF
|
||||
CONF.register_opts(impl_zmq.zmq_opts)
|
||||
CONF.register_opts(impl_eventlet._eventlet_opts)
|
||||
|
||||
|
||||
def main():
|
||||
CONF(sys.argv[1:], project='oslo')
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
|
||||
with contextlib.closing(impl_zmq.ZmqProxy(CONF)) as reactor:
|
||||
reactor.consume_in_thread()
|
||||
reactor.wait()
|
@ -29,6 +29,7 @@ from oslo.config import cfg
|
||||
|
||||
from oslo.messaging._drivers import base
|
||||
from oslo.messaging._drivers import common as rpc_common
|
||||
from oslo.messaging._executors import impl_eventlet # FIXME(markmc)
|
||||
from oslo.messaging.openstack.common import excutils
|
||||
from oslo.messaging.openstack.common import importutils
|
||||
from oslo.messaging.openstack.common import jsonutils
|
||||
@ -826,6 +827,7 @@ class ZmqDriver(base.BaseDriver):
|
||||
def __init__(self, conf, url, default_exchange=None,
|
||||
allowed_remote_exmods=[]):
|
||||
conf.register_opts(zmq_opts)
|
||||
conf.register_opts(impl_eventlet._eventlet_opts)
|
||||
|
||||
super(ZmqDriver, self).__init__(conf, url, default_exchange,
|
||||
allowed_remote_exmods)
|
||||
|
@ -30,6 +30,9 @@ setup-hooks =
|
||||
pbr.hooks.setup_hook
|
||||
|
||||
[entry_points]
|
||||
console_scripts =
|
||||
oslo-messaging-zmq-receiver = oslo.messaging._cmd.zmq_receiver:main
|
||||
|
||||
oslo.messaging.drivers =
|
||||
rabbit = oslo.messaging._drivers.impl_rabbit:RabbitDriver
|
||||
qpid = oslo.messaging._drivers.impl_qpid:QpidDriver
|
||||
|
Loading…
x
Reference in New Issue
Block a user