As soon as your system and application landscape widens, you try to create components which are independent of each other. One of the first steps is to create an asynchronous messaging architecture. This allows decoupling of components, but more importantly, you can also be implementation-independent by simply using standards of data exchange. There exist messaging standards such as AMQP or STOMP, which can be read by any application. The most well known, defined API for messaging in the Java world is JMS, the Java Message Service.
In this example Apache ActiveMQ will be used to let an arbitrary amount of Play instances communicate with each other. The communication will be done via a publish-subscribe mechanism which is called a topic in JMS terms. In order to get a short overview, there are two mechanisms, which could be chosen for this task. First a producer-consumer pattern, second a publish-subscribe pattern. The producer-consumer pattern however requires...