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
相关推荐
码农BookSea几秒前
10分钟掌握 JSON-RPC 协议,面试加分、设计不踩坑
后端
凤年徐27 分钟前
C++手撕红黑树:从0到200行,拿下STL map底层核心
c++·后端·算法
IT_陈寒27 分钟前
Python的列表推导式里藏了个坑,差点让我加班到凌晨
前端·人工智能·后端
递归尽头是星辰1 小时前
Spring Boot 配置排除失效深度解析:时序与机制核心
spring boot·自动配置·bean 加载·exclude失效·组件扫描
卷无止境2 小时前
podman与docker的区别和生产环境最佳实践
后端
程途知微2 小时前
ConcurrentHashMap线程安全实现原理全解析
java·后端
Mars酱2 小时前
1分钟编写贪吃蛇 | JSnake贪吃蛇单机版
java·后端·开源
卷卷说风控2 小时前
养了10年风控,今年开始养「虾」了
后端
王码码20352 小时前
Go语言中的Elasticsearch操作:olivere实战
后端·golang·go·接口
小锋java12342 小时前
SpringBoot 4 + Spring Security 7 + Vue3 前后端分离项目设计最佳实践
java·vue.js·spring boot