Spreading the word
The final collection capability offered by Hazelcast is a broadcast messaging system. This is very much inspired by the JMS topics and offers a comparable set of features. With these features, we can publish events onto the messaging bus, to deliver to a large number of subscribed receivers.
As we can see in the following diagram, an application can publish a message onto a topic, which will then be distributed to all the instances of the application that have subscribed to the topic. This will include the instance that originally sent the message in the first place, assuming that it has a listener subscribed to the topic, too:
First things first, we'll need a MessageListener class to handle messages so that we can implement an ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access