// create the event bus and subscribe two listeners
// notice how the registration process itself is unaware of clustering
EventBus eventBus = new ClusteringEventBus(clusterSelector);
eventBus.subscribe(new AnnotationEventListenerAdapter(new ThreadPrintingEventListener()));
eventBus.subscribe(new AnnotationEventListenerAdapter(new AnotherThreadPrintingEventListener()));
// publish an event
eventBus.publish(asEventMessage(new ToDoItemCompletedEvent("todo1")));
// we need to shutdown the executor we have created to prevent the JVM from hanging on shutdown