是否有任何静态代码分析工具可以在编译时发现,而不使用/订阅返回的Mono或Flux?
例如
public Mono<Void> someReactiveMethod() { ... }
// if you forget to subscribe to the returned Mono you will have fun at runtime
someReactiveMethod(); // should raise an error
答案 0 :(得分:0)
我认为尚无用于此目的的静态代码检查,但您可能想看看reactor-core
中的PublisherProbe
类,因此您可以轻松地测试Publisher
/ { {1}} / Mono
是否已订阅。