Commit Graph

21 Commits

Author SHA1 Message Date
Andy Smith f2fd8d4375 Remove the deprecated ZeroMQ driver
Users of the oslo.messaging RPC communications service must use
the rabbit ("rabbit://...") or AMQP 1.0 ("amqp://...") drivers.

Change-Id: If3474142f1fe99d41d7b4466061ed0e23ca38549
Closes-Bug: 1789259
2018-08-28 16:00:50 -04:00
Kenneth Giusti e12edd9887 [zmq] pass a dummy TransportURL to register_opts
zmq_options.register_opts() requires a TransportURL in the parameter
list.  This patch creates an empty TransportURL and passes it since
there is no actual URL available.

Change-Id: I5954e430eedc5904594ee3be49d460de4b99d89a
Closes-Bug: #1675425
2017-03-23 10:15:50 -04:00
ozamiatin 27594bd40f [zmq] Make second ROUTER socket optional for proxy
Since proxy supposed to be used in different configurations
second ROUTER socket may stay unused (e.g. when we use proxy
for publishing only fanout messages in mixed direct/pub-sub
configuration see ZmqClientMixDirectPubSub).

This patch introduces two modes of proxy SingleRouterProxy (where
frontend and backend ROUTERS are the same socket) and
DoubleRouterProxy (different sockets for the frontend and for the
backend - the original behavior).

Change-Id: Ia859b92e1f238fcbbcf42e17b06e0f4ad04e79f6
2016-09-26 11:41:29 +03:00
Gevorg Davoian e5785f614f [zmq] Add --log-file option to zmq-proxy
Change-Id: I1c41bc95ee545a13059c6aff9a4c53372284eecd
Closes-Bug: #1615623
2016-08-22 16:00:34 +03:00
Oleksii Zamiatin 7c5d039fd3 Move zmq driver options into its own group
ZeroMQ driver options are current stored into the DEFAULT group.
This change makes the zmq configuration clearer by putting its
options into oslo_messaging_zmq group.

Change-Id: Ia00fda005b1664750d2646f8c82ebdf295b156fb
Closes-bug: #1417040
Co-Authored-By: Oleksii Zamiatin <ozamiatin@mirantis.com>
2016-08-05 11:36:50 +03:00
Oleksii Zamiatin 18c8bc933d [zmq] Let proxy serve on a static port numbers
Currently proxy binds to a random port from a port range
specified in zmq config and therefore needs to register in
redis to become visible to clients and servers.

That could be done much simpler by using a static port(s) for
proxy. Moreover zmq handles reconnect to a socket if restarted
service uses the same port number as it had before restart.

Change-Id: I088792fd08a4161d08e9160830fc3ec4d560cca4
2016-07-22 19:00:48 +03:00
ozamiatin 9cdc9e006b [zmq] Add backend ROUTER to increase bandwidth
As for zmq we have a native thread running per each
zmq socket to perform async send/receive. Bandwidth
should increase by adding one more ROUTER socket to proxy.
We can not add more because it will increase the number
of connections, but with FE and BE sockets number of
connections will stay the same as with a single ROUTER,
because all clients will connect to FE, and all servers
will connect to BE.

Change-Id: Ib1f070a503272164ec0e9c28ce20530cfa6b79aa
2016-05-10 14:55:09 +03:00
ozamiatin b5955b6ca9 [zmq] Redesign router proxy
In this change router was redesigned in a way most
appropriate for routing concept of zmq.ROUTER socket.

DEALER(cli)-ROUTER(proxy)-DEALER(srv) instead of
DEALER-ROUTER-DEALER-ROUTER (3 layers instead of 4)

The main reason is to use zmq.DEALER identity in message
routing. For this reason DealerConsumer was introduced
server-side. RouterConsumer is left for peer-to-peer
DEALER-ROUTER deployment option.

Also handled assertions in receive-methods in order
to not stop server when received message with wrong format.

Change-Id: If25edf500fa8d220d4233bb13d67121824e841c6
Closes-Bug: #1558601
Related-Bug: #1555007
2016-05-04 15:12:10 +03:00
ozamiatin 192eeb4334 [zmq] Reduce threading from python proxy
Remove threading executor from publisher and router proxies
because each proxy is running in its own process.
Zmq native poller should be used for asynchronous polling.

Change-Id: Id8d6699cfd78ffbcd5b63773a6f2289183cd3126
Closes-Bug: #1569530
2016-04-21 13:40:12 +03:00
Oleksii Zamiatin cc1cb30321 [zmq] Reduce number of connections
In this change 'use_router_proxy' option was added
to switch between direct connections and proxy.

Proxy was reimplemented and splitted onto two
types of proxies:

    * PUBLISHER proxy for fanout pattern
    * ROUTER proxy for direct messaging

Each type of proxy is configured over command line
argument --type.

Deployment guide was updated accordingly to the change.

Change-Id: If36e9c26e2a8ebe622cfa7e9f2a07b1a69aabe34
Closes-Bug: #1555007
2016-03-31 15:40:36 +03:00
dukhlov 1482687ff7 Move server's logic from executors
Now we have situation when openstack projects like Mistral needs
extra oslo.messaging functionality.

 But it is too complicated now to to implement something new and
 integrate it with current code because there is a little bit mess.
 1) Executor should be responsible for how to run jobs
      (but now also has code with server logic)
 2) Dispatcher should be responsible for routing message to the
     target endpoint for processing (but it also has serialisation, sending replies,
     executing some executor's callbacks etc)
 3) Server should do all server specific logic, we need to have different
      implementation of servers for RPC and notification, not different implementations
      of dispatchers

 This patch fixes 1-st point

Change-Id: Ib6408f408889bb7b7056722be636a5547b1a780d
2016-02-23 15:00:58 +00:00
Oleksii Zamiatin e7d6e92ea7 [zmq] Fix slow down
Restore use_pub_sub to default True.
Fix broker closed by mistake.

Change-Id: Ibc370d401d233059f7cbe8e7d5b15136910c8be7
2016-01-29 17:14:45 +02:00
Jenkins 4512523be7 Merge "[zmq] Support KeyboardInterrupt for broker" 2016-01-26 21:41:43 +00:00
Oleksii Zamiatin 3c41df990b [zmq] Support KeyboardInterrupt for broker
Change-Id: I3363b42c2c73d32f9c883888a6784055cab41f18
Closes-Bug: #1538083
2016-01-26 14:57:58 +02:00
Javeme 166cfbfb1b Fixed a couple of pep8 errors/warnings
Fixed pep8 errors:
 * E127 continuation line over-indented for visual indent
 * E226 missing whitespace around arithmetic operator
 * E231 missing whitespace after ','
 * E241 multiple spaces after ','
 * E261 at least two spaces before inline comment
 * E301 expected 1 blank line, found 0
 * E302 expected 2 blank lines, found 1
 * E303 too many blank lines (2)
 * E501 line too long (80 > 79 characters)

Fixed pep8 warnings:
 * W292 no newline at end of file
 * W391 blank line at end of file

Change-Id: I1736f8a42c3a335a17a0b9b6e64782487ed3a495
2016-01-25 15:00:49 +08:00
Oleksii Zamiatin 3067dbd198 Non-blocking outgoing queue was implemented
The main issue with eventlet.green.zmq is that libzmq as a C-library
is completely monkey-patch unfriendly. So any blocking call inside
the native library makes calling process stuck. We can't avoid this
actually in an absolutely normal situation when a client appears
earlier than listener we have all client process get stuck until listener
raised. If the listener for example is also blocked awaiting for some
other service to appear we have a chain of locks which may occasionally
result in a dead-lock. The other situation with Notifier is quite similar.

For that reason zmq-broker was restored, but now it serves as an outgoing
queue on a client side. Servers remained the same dynamically port-binded.
Now all clients can still use green-zmq, but presence of the broker-queue
on a host guarantees that green threads will never blocked in a client
because all messages will wait their listeners inside the broker queue.
The broker process's modules are not monkey-patched, they make use of native
threading and native zmq.

Possibility to run without broker also remains. The option zmq_use_broker
introduced for that reason.

Closes-Bug: #1497315

Change-Id: I786b100fd6ee1cf4b99139db0ca044d358d36345
2015-09-28 14:14:53 +03:00
Oleksii Zamiatin 315e56ae2b Get rid of proxy process in zmq
As far as we use redis as a name service we don't need a proxy,
becase we can pass binded port over name service too.

Change-Id: I59bbe2b34dcedfeef113ef06d6a988e1c413405e
2015-07-27 12:29:08 +03:00
Oleksii Zamiatin ebcadf3d5e Fix threading zmq poller and proxy
- Fixed universal proxy to not get stuck with multiple backends
- Fixed threading pollers/executors (proxy side)
    - Driver option to switch green/no-green impl.
    - Swtiched to no-green in real-world proxy (green left for unit tests)
- Minor names fixes in serializer

Change-Id: Id6508101521d8914228c639ed58ecd29db0ef456
2015-07-15 16:46:04 +03:00
Victor Sergeyev bcdc0e88ec ZMQ: Allow to raise remote exception
This patch adds possibility to re-raise on client's side exception, that
was raised on server side - serialize it on server side, restore and
re-raise on client.
Allowed to pass `allowed_remote_exmods` parameter from impl_zmq to
CallRequest class

Functional test CallTestCase.test_exception() passes now, so added it to
tox.ini. Modified zmq_receiver to be able run functional tests.

Change-Id: Ic055f3574962f3e80a0528d5d99320386303634e
2015-07-09 19:57:55 +00:00
Doug Hellmann ee31a84719 Update Oslo imports to remove namespace package
Change-Id: I4ec9b2a310471e4e07867073e9577731ac34027d
Blueprint: drop-namespace-packages
2015-01-21 21:09:33 -05:00
Doug Hellmann e55a83e832 Move files out of the namespace package
Move the public API out of oslo.messaging to oslo_messaging. Retain
the ability to import from the old namespace package for backwards
compatibility for this release cycle.

bp/drop-namespace-packages

Co-authored-by: Mehdi Abaakouk <mehdi.abaakouk@enovance.com>
Change-Id: Ia562010c152a214f1c0fed767c82022c7c2c52e7
2015-01-12 12:50:41 -05:00