title: When to use an Event Bus?
body: <p>I'm designing the backend for a new Java web app and am trying to decide whether or not to use an Event Bus; specifically the <a href="https://google.github.io/guava/releases/23.0/api/docs/com/google/common/eventbus/EventBus.html" rel="noreferrer">Guava <code>EventBus</code></a>.</p>
  
  <p>Most server-side requests will be synchronous: that is, the user is requesting data and needs a response within a few seconds. However, there are also quite a few number of requests that can be asynchronous and that are "fire and forget" on the client-side. So long as they eventually are processed, the client could care less if it takes 2 secondds to process or 2 hours.</p>
  
  <p>For these asynchronous requests, I plan to have the servlet listening at the mapped URL publish the requests to a queue. A consumer will then dequeue each request and route it on to the appropriate handler. This is where the <code>EventBus</code> may or may not come into play. The business logic for routing the request to the correct handler is pretty complex. Ordinarily a Camel route would be the perfect solution. In my use case, I'm wondering if I can just wire up a bunch of "processors" (event handlers) to the same event bus, and then have each one firing and receiving events to and from each other until an end result is produced.</p>
  
  <p>I would like to say that I already explored using Apache Camel, and that I do believe that Camel's the right tool for the job here. Sadly, for reasons outside the scope of this question, I'm not going to use it. So I started conjuring up Camel-like solutions, which is how I arrived at Guava's <code>EventBus</code>. But it just might not be a suitable replacement.</p>
  
  <p><strong>I guess I'm looking for the problem classification that the <code>Event Bus</code> pattern solves, and then I need to determine if that matches my use case here.</strong></p>