In my projects, the underlying message broker or even db is usually abstracted away from the application logic. So it would really be the dependency that I replace (for the most part). But if you're fine with something more invasive then you may want to look at
https://vertx.io/ as well. It's not like creating your own message broker but it can make use of Kafka or rabbitmq