Inspectopedia
 
2024.3

Calling 'subscribe' in "reactive" methods

Warning
New
Last modified: 03 December 2024

Reports subscribe() calls in "reactive" methods.

Methods returning a Publisher type (including Flux and Mono) 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(), zip(), then(), and so on.

Example: