Spring 5 » Very similar to rxjava but optimized for Java 8+ » No additional dependencies » OSGi ready Flux.interval(of(1, ChronoUnit.MILLIS)) .window(2, 1) .flatMap(win -> MathFlux.averageDouble(win)); .subscribe(System.out::println); 0.5, 1.5, 2.5, 3.5, ...
in DSL » Use any DSL based on reactive streams API » Optimized for OSGi but also works in plain java public interface RComponent { <T> Publisher<T> from(String destination, Class<T> type); <T> CloseableSubscriber<T> to(String destination, Class<T> type); }
service @Reference(target="(name=mqtt)") RComponent mqtt; Send a counter to mqtt every second Flux.interval(Duration.ofSeconds(1)) .map(ByteArrayConverter::fromLong) .subscribe(mqtt.to("input", byte[].class));
components depend on camel core » Acquired too many features over time without proper design changes (async, transactions, tracing, …) » No support for backpressure
OSGi Push streams is a great DSL and engine but » Only used on OSGi -> much smaller eco system » Not compatible to reactive streams API » Does not have a small API suitable for components » Can not be used with a different DSL
a lot more resilient in high load situations (backpressure) » Makes it easier to code in an asynchronous way but » Only works well if all steps are non blocking » Much of the infrastructure as well as user code is still blocking » Coding in a reactive DSL is a very steep learning curve