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 ...

Get Getting Started with Hazelcast - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.