// we get the event bus from the application context
EventBus eventBus = applicationContext.getBean(EventBus.class);
eventBus.publish(asEventMessage(new ToDoItemCompletedEvent("todo1")));
// we close the application context to make sure everything shuts down properly
applicationContext.stop();
applicationContext.close();
}
public static class ThreadPrintingEventListener {