When to use an Event Bus? [closed]

Here is the problem statement that EventBus solves in a nutshell:

“I want an easy, centralized way to notify code that’s interested in specific types of events when those events occur without any direct coupling between the code that publishes an event and the code that receives it.”

When you say “the business logic for routing the request to the correct handler is pretty complex”, I suspect that EventBus may not be what you’re looking for, as it routes based on Java object class only (though you can do some fancy stuff with implementing interfaces on your event classes and having subscribers subscribe to specific interfaces).

Leave a Comment