[zeromq-dev] subports

Martin Sustrik sustrik at 250bpm.com
Wed Jul 27 14:52:30 CEST 2011

On 07/27/2011 12:55 PM, Pieter Hintjens wrote:

> You're assuming services are independent, which isn't the use case. Of
> course independent services can exist on their own ports. That's
> obvious.

Whether services are dependent or independent should be completely 
transparent to the client.

The idea here is that you can distribute the server-side application 
while keeping the clients intact. Say, if you are an stock exchange you 
can start with with market data publisher and order gateway collocated 
in the same process, however, as you grow you will possibly distribute 
the market data from a set of gateways completely separate from order 
management gateways.

As for the subports, AFAICS the ultimate requirement here is to lower 
the time-to-market by circumventing the administrative processes on the 
client site, which in turn translates to "open a port once, don't get 
hit by the same thing later on as you evolve your service".

In short, it should be possible to funnel all the traffic via a single 
port, irrespective of how your server-side service topology looks like.

To give a simple example: Imagine service A using port 5555, subport 1 
and B using port 5555, subport 2.

Imaging the A's box burns down and so the admin starts an instance of A 
on the B's box.

If port mutliplexer is located in-process, A fails with EADDRINUSE 
(because both processes try to bind to the same port) although there is 
no address collision (each service uses a different subport).


More information about the zeromq-dev mailing list