[zeromq-dev] content based routing for a thread pool
Lei Jiang
lei.jiang.29 at gmail.com
Sat Oct 21 13:05:08 CEST 2023
Hi,
I hope someone can kindly give me a point in the right direction.
What I want to achieve is to have a thread pool with a bunch of REP sockets
in each thread to handle requests. A ROUTER socket binds to the server
address:port. A DEALER socket binds to an inproc address. All REP sockets
connect to the inproc address. And finally a proxy() call will bridge the
ROUTER and DEALER sockets.
This pattern works as it is. But I need more. The pool must route the
requests to certain threads based on the contents. For that, I am ready to
write my own proxy() function. I read from the guide that putting an
identity frame followed by a blank frame and then the message body can
route the message to a certain peer. But my bigger problem is it seems I
can't use DEALER any more. It has to be ROUTER <=> ROUTER, and I will have
to maintain the sessions myself. I guess largely it's what's in the pipe_t,
which is not exposed.
Am I right about this? Or is there a better way?
Thanks a lot!
Lei
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20231021/83eda085/attachment.htm>
More information about the zeromq-dev
mailing list