Architectural Overview
Java Event Bus is an asynchronous in-memory event routing framework designed for modular monoliths requiring microsecond-level dispatch latency without the latency overhead or network serialization costs of external message brokers.
Key Architectural Highlights
- Non-Blocking Core: Implements lock-free internal queuing using
ConcurrentLinkedQueueand atomic CAS (Compare-And-Swap) operations on the hot path, eliminating thread contention. - Explicit Concurrency Boundaries: Lock-free in unbounded mode; for bounded capacity scenarios, employs explicit backpressure policies (
REJECTviaRejectedExecutionExceptionorDROPwith drop-rate observability metrics). - Flexible Dispatch Modes: Supports both broadcast/fan-out delivery (all subscribed handlers receive events) and round-robin load-balanced delivery (single consumer per event).
- Asynchronous Orchestration: Coordinated using Java 21
CompletableFuturechains with dedicated, thread-pool-isolated subscriber execution. - Stress-Tested Rigor: 42 multi-threaded concurrency stress tests validating strict ordering, backpressure enforcement, and zero race conditions under heavy subscriber loads.