cascadium/OpenMAMA-zmq

Add ability to have multiple incoming and outgoing uris

fquinner opened this issue · 2 comments

This is important for daemon-free fan-in and fan-out (e.g. subscribing to more than one publisher in a single transport).

This work has been completed but it depends on an OpenMAMA pull request to land first so I have staged the change in a new 'next' branch until it lands and the next OpenMAMA release is out.

finos/OpenMAMA#183

Actually I may revisit this and use existing code to parse configuration parameters so we can have this without waiting on next OpenMAMA release.

Revisited the approach to use existing code instead - now onto master. So if you have two publishers:

# This is where all messages will be published including requests
mama.zmq.transport.pub.outgoing_url_0=tcp://*:5557
# This is where all messages will be received including replies
mama.zmq.transport.pub.incoming_url_0=tcp://*:5556

# This is where all messages will be published including requests
mama.zmq.transport.pub2.outgoing_url_0=tcp://*:5559
# This is where all messages will be received including replies
mama.zmq.transport.pub2.incoming_url_0=tcp://*:5558

You can now connect to them with a single subscriber like so:

# This is where all messages will be published including requests
mama.zmq.transport.subdual.outgoing_url_0=tcp://localhost:5556
# This is where all messages will be received including replies
mama.zmq.transport.subdual.incoming_url_0=tcp://localhost:5557
# Connect to additional publisher 'pub2'
mama.zmq.transport.subdual.outgoing_url_1=tcp://localhost:5558
mama.zmq.transport.subdual.incoming_url_1=tcp://localhost:5559

This makes it easier to connect multiple publishers and subscribers without the need for an intermediary.