Is there any static code analysis tool available that can spot at compile-time whether a returned Mono or Flux was not used / subscribed to?
Eg
public Mono<Void> someReactiveMethod() { ... }
// if you forget to subscribe to the returned Mono you will have fun at runtime
someReactiveMethod(); // should raise an error
我认为尚无用于此目的的静态代码检查,但您可能想看一下reactor-core
中的PublisherProbe
类,让您轻松测试是否已订阅Publisher
/ Mono
/ Flux
。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.