[openstack-dev] [oslo][messaging][zmq] Discussion on zmq driver design issues
ozamiatin at mirantis.com
Wed Mar 4 17:10:00 UTC 2015
By this e-mail I'd like to start a discussion about current zmq driver
internal design problems I've found out.
I wish to collect here all proposals and known issues. I hope this
discussion will be continued on Liberty design summit.
And hope it will drive our further zmq driver development efforts.
ZMQ Driver issues list (I address all issues with # and references are
1. ZMQContext per socket (blocker is neutron improper usage of messaging
via fork) 
2. Too many different contexts.
We have InternalContext used for ZmqProxy, RPCContext used in
ZmqReactor, and ZmqListener.
There is also zmq.Context which is zmq API entity. We need to
consider a possibility to unify their usage over inheritance (maybe
stick to RPCContext)
or to hide them as internal entities in their modules (see
3. Topic related code everywhere. We have no topic entity. It is all
We need some topics management entity and topic itself as an entity
(not a string).
It causes issues like , . (I'm already working on it).
There was a spec related .
4. Manual implementation of messaging patterns.
Now we can observe poor usage of zmq features in zmq driver. Almost
everything is implemented over PUSH/PULL.
4.1 Manual polling - use zmq.Poller (listening and replying for
4.2 Manual request/reply implementation for call .
Using of REQ/REP (ROUTER/DEALER) socket solves many issues. A
lot of code may be reduced.
4.3 Timeouts waiting
5. Add possibility to work without eventlet . #4.1 is also related
here, we can reuse many of the implemented solutions
like zmq.Poller over asynchronous sockets in one separate thread
(instead of spawning on each new socket).
I will update the spec  on that.
6. Put all zmq driver related stuff (matchmakers, most classes from
zmq_impl) into a separate package.
Don't keep all classes (ZmqClient, ZmqProxy, Topics management,
ZmqListener, ZmqSocket, ZmqReactor)
in one impl_zmq.py module.
+-- impl_zmq.py <- leave only ZmqDriver class here
+-- zmq_driver (package)
| +--- matchmaker.py
| +--- matchmaker_ring.py
| +--- matchmaker_redis.py
| +--- matchmaker_.py
| +--- client.py
| +--- reactor.py
| +--- proxy.py
| +--- topic.py
7. Need more technical documentation on the driver like .
I'm willing to prepare a current driver architecture overview with
some graphics UML charts, and to continue discuss the driver architecture.
Please feel free to add or to argue about any issue, I'd like to have
your feedback on these issues.
More information about the OpenStack-dev