logoalt Hacker News

Emissary, a fast open-source Java messaging library

22 pointsby jeyjeyememlast Thursday at 6:15 PM10 commentsview on HN

Comments

jeyjeyememlast Thursday at 6:15 PM

Emissary is a simple-to-use, no dependency, yet BLAZING FAST messaging library for decoupling messages (requests and events) and message handlers.

Emissary aims to take advantage of the simplicity of using the annotations for handlers (e.g. @RequestHandler/@EventHandler) without the drawbacks of reflection (slow).

What differentiates Emissary from other messaging/dispatch libraries? It takes advantage of java.lang.invoke.LambdaMetafactory to avoid the cost of invoking methods reflectively. This results in performance close to directly invoking the request handler and event handler methods.

~ 1000% more throughput compared to other similar libraries (Spring's ApplicationEventPublisher, Pipelinr, EventBus) ~ 90% faster compared to other similar libraries (Spring's ApplicationEventPublisher, Pipelinr, EventBus)

Benchmarks found on the GitHub repository: https://github.com/joel-jeremy/emissary?tab=readme-ov-file#p...

show 2 replies
RedShift1today at 11:37 AM

I'm a big fan of Guava's EventBus. Easy to implement and straightforward to understand. This library does seem to require more setup and I don't see the immediate advantages, also why does it require an instanceProvider? I don't understand what that does.

andypipertoday at 10:51 AM

Naming collision with an ActivityPub server https://emissary.dev/

show 2 replies