Inspectopedia Help

Calling 'subscribe' in "reactive" methods

Reports subscribe() calls in "reactive" methods.

Methods returning a publisher (including Uni and Multi) should not call the subscribe() method directly because it can break the reactive call chain.

Instead of using subscribe(), consider using composition operators like flatMap(), merge(), and so on.


Multi<String> stringMulti(){ Multi<String> multi = Multi.createFrom().item("abc"); multi.subscribe(); // <- blocking 'subscribe' call in non-blocking context return multi; }

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3


Reactive Streams, 233.SNAPSHOT

Last modified: 13 July 2023