-
Notifications
You must be signed in to change notification settings - Fork 904
Multiple Destinations
Both Publications and Subscriptions in Aeron can support the concept of multiple simultaneous destinations. For Publications, this means the outgoing stream is sent to each destination individually. For subscriptions, this means the incoming stream(s) may be received by a number of individual endpoints.
Aeron Publications can be configured to operate in a multiple destination mode separate from UDP multicast. Whereas multicast sends to an IP multicast address, Multi-Destination-Cast (MDC) sends a UDP unicast stream to each Receiver individually. This behavior mimics UDP multicast operation for purposes of Flow and Congestion Control. Each destination is treated as a normal multicast receiver would be handled with respect to flow and congestion control.
An MDC Publication operates in one of two modes. It either dynamically allows destinations to be added and removed or manually controls the add and remove of destinations.
In dynamic control mode, the Publication uses a control
address (see Channel Configuration)[Channel-Configuration.md] to specify the address and port that the publication will use for receiving Status Messages and NAKs as well as the point of contact for the Publication to add and remove destinations dynamically. Multi-Destination-Cast dynamic publication using control port of 40456.
aeron:udp?control=localhost:40456
The Subscriptions will need to specify the of this control address and port in addition to their own endpoint
address. Multi-Destination-Cast dynamic subscription using local endpoint port of 40457 and control port at 192.168.0.1 and port 40456
aeron:udp?endpoint=localhost:40457|control=192.168.0.1:40456|control-mode=dynamic
Subscriptions that go away will be timed out by the Publication and the Publication will stop sending data to them and accounting for them with flow control.
In control-mode=manual
operation. The application calls Publication.addDestination
to add specific destination endpoints and removes them explicitly with Publication.removeDestination
. Multi-Destination-Cast manual publication using control port of 40456.
aeron:udp?control=localhost:40456|control-mode=manual
Subscriptions do not need to specify control address and port with manual mode. Normal endpoint
specification is adequate.
The destination channel used with Publication.addDestination
and Publication.removeDestination
should only include endpoint
specification. All else will be ignored.