You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I defined a discoveryclient, which runs normally in a normal web service and can correctly obtain service information based on the service name. However, in the springcloudgateway service, an error is reported and my custom discoveryclient is not called. Why?
error:
2025-01-10T17:10:00.170+08:00 WARN 70762 --- [ctor-http-nio-2] o.s.c.l.core.RoundRobinLoadBalancer : No servers available for service: test-service1
2025-01-10T17:10:00.206+08:00 ERROR 70762 --- [ctor-http-nio-2] a.w.r.e.AbstractErrorWebExceptionHandler : [02572793-1] 500 Server Error for HTTP GET "/TestApi"
java.lang.IllegalStateException: block()/blockFirst()/blockLast() are blocking, which is not supported in thread reactor-http-nio-2
at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:83) ~[reactor-core-3.5.0.jar:3.5.0]
Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Error has been observed at the following site(s):
*__checkpoint ⇢ org.springframework.cloud.gateway.filter.WeightCalculatorWebFilter [DefaultWebFilterChain]
*__checkpoint ⇢ HTTP GET "/TestApi" [ExceptionHandlingWebHandler]
Original Stack Trace:
at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:83) ~[reactor-core-3.5.0.jar:3.5.0]
at reactor.core.publisher.Mono.block(Mono.java:1710) ~[reactor-core-3.5.0.jar:3.5.0]
at org.springframework.cloud.loadbalancer.blocking.client.BlockingLoadBalancerClient.choose(BlockingLoadBalancerClient.java:160) ~[spring-cloud-loadbalancer-4.0.0.jar:4.0.0]
at org.springframework.cloud.openfeign.loadbalancer.RetryableFeignBlockingLoadBalancerClient.lambda$execute$2(RetryableFeignBlockingLoadBalancerClient.java:157) ~[spring-cloud-openfeign-core-4.0.0.jar:4.0.0]
at org.springframework.retry.support.RetryTemplate.doExecute(RetryTemplate.java:329) ~[spring-retry-2.0.0.jar:na]
at org.springframework.retry.support.RetryTemplate.execute(RetryTemplate.java:225) ~[spring-retry-2.0.0.jar:na]
at org.springframework.cloud.openfeign.loadbalancer.RetryableFeignBlockingLoadBalancerClient.execute(RetryableFeignBlockingLoadBalancerClient.java:135) ~[spring-cloud-openfeign-core-4.0.0.jar:4.0.0]
at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:102) ~[feign-core-12.1.jar:na]
at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:72) ~[feign-core-12.1.jar:na]
The text was updated successfully, but these errors were encountered:
Indeed, openfeign cannot be used here. I solved this problem because the discoveryclient I defined was wrong and ReactiveDiscoveryClient is required in springcloudgateway. Thank you so much
I defined a discoveryclient, which runs normally in a normal web service and can correctly obtain service information based on the service name. However, in the springcloudgateway service, an error is reported and my custom discoveryclient is not called. Why?
The text was updated successfully, but these errors were encountered: