|
The publish-subscribe example is a simple system where information flows from a single producer to zero or more consumers. This example represents an interesting family of distributed systems that have well-defined data sources and are based on reporting, measurements or filtering.
In this example the publisher is a regular server that establishes a listener on the given target and that exposes one object which can handle subscriptions from clients. The client program can be started in many instances, which shows that the management of subscriptions is well encapsulated so that the publisher can focus only on producing its data.
The easiest way to try this example is to perform the following actions:
tcp://*:*
. The publisher will print its resolved target on the screen. After that the publisher will print a random value every second - this random value is published to whoever might be subscribed at any given moment.