This is my rule of thumb.
When I first design my application I ask myself that question : are these two classes always gonna be tight (i.e. "it's the same service", i.e. "both classes have the same release cycle, the same scalability needs, etc."
If the answer is "yes", then I go with two classes, communicating in an "OO" way.
If the answer is "no". Here are the main reasons leading me to think "these are separated (micro-)services" :
- they have different business purposes (handling HTTP traffic vs. sending emails for instance)
- they are losely-coupled
- they have different release cycle (one could be released twice a day, the other one once a month)
- they have different scalability needs (handling HTTP traffic means high scalability, sending an email once a day doesn't require many event-loops)
- one service could be targeted in different ways (from my service #1 obviously, from an admin's browser, from a REST API, etc.)
- they have different "technical needs" (high-availability for one, not for the other, etc.)
Then I tell myself : "Maybe not today, but in a near future, both services will run in separated JVM". And then, I expose service #2's API through the event-bus (either by writing my own message protocol, or by using Vertx's service proxy).
For me this is the main advantage of the event-bus : having the flexibility to deploy services :
- same JVM, different JVM
- same server, different servers
- use 8 evebt-loops vs. use only 1 event-loop.
- shutdown one service, while the other one will still be running for other clients.
Hope this helps.