Debugging Reactor streams

Debugging Rector streams is not straightforward. This is due to the fact that all stream processing in Reactor is asynchronous and non-blocking. In a synchronous and blocking system, an error stacktrace points to the root cause of the issue. However, in an asynchronous reactor stream, the error is logged in the Subscriber but has been raised in an operator in stream processing. The error stacktrace does not mention the operator. Let's take a look at the following Reactor stacktrace:

reactor.core.Exceptions$ErrorCallbackNotImplemented: java.lang.IllegalStateExceptionCaused by: java.lang.IllegalStateException    at ReactorDebug.lambda$testPublisherStub$1(ReactorDebug.java:22) at reactor.core.publisher.FluxGenerate$GenerateSubscription.fastPath(FluxGenerate.java:223) ...

Get Hands-On Reactive Programming with Reactor now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.