In order to integrate the Apache Kafka cluster into the application this example will use Kafka's Java API.
The applications connect to Kafka to consume messages in their updating consumers and event handlers. The same is true for publishing events.
The used technology should be encapsulated from the rest of the application. In order to integrate the events, developers can use a functionality that naturally fits this scenario: CDI events.