Процесс фильтрации микронавтов вернет Publisher, но если я попытаюсь подписать результат от издателя, он выдаст
13:37:24.721 [nioEventLoopGroup-1-2] ERROR i.m.h.s.netty.RoutingInBoundHandler - Unexpected error occurred: Only one subscriber allowed
java.lang.IllegalStateException: Only one subscriber allowed
at io.micronaut.core.async.processor.SingleSubscriberProcessor.subscribe(SingleSubscriberProcessor.java:55)
at io.micronaut.http.server.netty.binders.PublisherBodyBinder.lambda$null$0(PublisherBodyBinder.java:83)
at io.reactivex.internal.operators.single.SingleFromPublisher.subscribeActual(SingleFromPublisher.java:35)
at io.reactivex.Single.subscribe(Single.java:3603)
BAD контроллер
@Post
public Single<Map<String, String>> test(@Body Single<Map<String, String>> input) {
return input;
}
Хороший контроллер
@Post
public Single<Map<String, String>> test(@Body Map<String, String> input) {
return Single.just(input);
}
Простой фильтр
@Override
public Publisher<MutableHttpResponse<?>> doFilter(HttpRequest<?> request, ServerFilterChain chain) {
Publisher<MutableHttpResponse<?>> actual = chain.proceed(request);
Publisher<MutableHttpResponse<?>> actual = chain.proceed(request);
actual.subscribe(mysubscribe);
return actual;
}
Я чувствую, что это ошибка. просто спросите здесь сначала. Спасибо