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
相关推荐
大勇前进4 小时前
告别 div 满天飞,HTML5 语义化标签真的有必要用吗?
后端
小满zs4 小时前
Go语言第六章(结构体)
后端·go
属于自己的天空4 小时前
每天省去重复 Prompt:我用 Skills 把 CRUD 生成标准化了
前端·后端
卡卡罗特AI4 小时前
GitHub怎么用?零基础,保姆级使用教程-上!建议收藏
前端·后端·github
老孙讲技术4 小时前
家长端看幼儿园 live:云直播 HLS 嵌入公众号 / H5 的合规要点
后端·物联网
xingren4 小时前
CT(DCM)外轮廓实时识别 → 逐层拼3D → 导出STL到Blender
后端
foggyprojects4 小时前
同一条销售查询,两个用户为什么看到不同结果?
后端
梅头脑4 小时前
Java镜像1.2GB→200MB,K8s Pod OOMKilled 137半夜报警——容器化的真实踩坑记录
后端
netCode4 小时前
IDEA使用 Alibaba Cloud Toolkit
后端