[zeromq-dev] zeromq routing branch request-response example

Martin Sustrik sustrik at fastmq.com
Wed May 6 09:24:58 CEST 2009


Jon,

> Following on from the discussions here
> 
> http://lists.zeromq.org/pipermail/zeromq-dev/2009-April/000710.html
> 
> on the list about the routing branch and request-reponse on top of topic based 
> routing , here are attached two small zmq example programs modified from 
> Martin's original topic pub/sub examples.
> 
> 1) zrr.cpp
> This is a simple server. It creates a global exhange and global queue.
> Requests come in on a topic (asingle char) and are published out on the 
> topic +1.
> 
> 2) zprr.cpp 
> This is the simple client. It publishes a message on a 1-char topic and 
> subcribes to responses on that topic +1 (ie request is topic 'A' , response 
> is on 'B').

What about using these as a basis for future req/rep example to be 
shipped with 0MQ?

The only challenge is to come up with a req/rep scenario that:

1. can be compiled on all platforms (i.e. no fancy libraries)
2. its business logic is simple enough not to overshadow the messaging 
part in the example
3. is not completely boring

Maybe a simple file lookup service? Send a filename, get first 100 
characters form the beginning of the file? Or a multiplayer game? Server 
thinks of an animal, clients are guessing...

Any funny ideas?
Martin



More information about the zeromq-dev mailing list