SpringBoot Gateway整合过程中的问题

现象描述:

第一次请求正常,第二次报错,错误如下:

java 复制代码
2023-12-25 00:47:46.928 ERROR 5484 --- [ctor-http-nio-6] a.w.r.e.AbstractErrorWebExceptionHandler : [34ab38d8-2]  500 Server Error for HTTP GET "/gateway/config/ip/get?id=1"

io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: no further information: /10.244.22.41:8080
	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 "/gateway/config/ip/get?id=1" [ExceptionHandlingWebHandler]
Original Stack Trace:
Caused by: java.net.ConnectException: Connection refused: no further information
	at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
	at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
	at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:337)
	at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:334)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:776)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.lang.Thread.run(Thread.java:748)

原因是,以下配置设置为true,设置为false即可。还没有追其原因,暂时先这样处理,随后再深入查下原因。

yaml 复制代码
spring:
  cloud:
    gateway:
      discovery:
        locator:
          enabled: true
相关推荐
你在我身后1 小时前
Spring-JAVA
java·后端·spring
Vin__4 小时前
微信小程序客服消息接收不到微信的回调
spring boot·微信小程序·小程序
路在脚下@4 小时前
Java使用Redisson实现布隆过滤器
java·spring boot
多敲代码防脱发6 小时前
Spring框架基本使用(Maven详解)
java·网络·后端·spring·maven
周盛欢6 小时前
Spring Boot应用开发
spring boot
Asthenia04126 小时前
Mybatis实践——Wrapper&&三表联查&&BaseMapper和Service的功能分异
后端
B站计算机毕业设计超人6 小时前
计算机毕业设计SpringBoot+Vue.jst0甘肃非物质文化网站(源码+LW文档+PPT+讲解)
java·vue.js·spring boot·后端·spring·intellij-idea·课程设计
why技术7 小时前
可以说是一个奇形怪状的面试题:Bean中的CHM要不要加volatile?
后端·面试
m0_748254667 小时前
定时任务特辑 Quartz、xxl-job、elastic-job、Cron四个定时任务框架对比,和Spring Boot集成实战
java·spring boot·后端