当前位置:网站首页>gateway先启动其他微服务,在启动网关,网关启动不了,且无异常日志;先启动网关,所有服务能正常启动
gateway先启动其他微服务,在启动网关,网关启动不了,且无异常日志;先启动网关,所有服务能正常启动
2022-06-11 20:56:00 【qq_21480329】
升级spring boot到2.7.0,gateway先启动其他微服务,在启动网关,网关启动不了,但是网关也没有任何异常日志,仅仅是一直等待状态,查看nacos服务未正常注册;先启动网关,所有服务能正常启动,产看nacos服务,所有服务能正常注册。
最终发现是Feign导致,Spring Cloud Gateway使用OpenFeign卡死,启动不了。当在gateway网关中使用Feign时,就会导致gateway网关启动一直卡着,然而也不报错。
日志无异常情况,详细日志如下:
:: Spring Boot :: (v2.7.0)
2022-06-04 20:41:37.627 INFO 28144 --- [ main] c.a.n.c.c.impl.LocalConfigInfoProcessor : LOCAL_SNAPSHOT_PATH:/Users/carter/nacos/config
2022-06-04 20:41:37.644 INFO 28144 --- [ main] c.a.nacos.client.config.impl.Limiter : limitTime:5.0
2022-06-04 20:41:37.712 INFO 28144 --- [ main] c.a.nacos.client.config.utils.JvmUtil : isMultiInstance:false
2022-06-04 20:41:37.731 WARN 28144 --- [ main] c.a.c.n.c.NacosPropertySourceBuilder : Ignore the empty nacos configuration and get it based on dataId[gateway] & group[DEFAULT_GROUP]
2022-06-04 20:41:37.757 WARN 28144 --- [ main] c.a.c.n.c.NacosPropertySourceBuilder : Ignore the empty nacos configuration and get it based on dataId[gateway.yml] & group[DEFAULT_GROUP]
2022-06-04 20:41:37.758 INFO 28144 --- [ main] b.c.PropertySourceBootstrapConfiguration : Located property source: [BootstrapPropertySource {name='bootstrapProperties-gateway.yml,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-gateway,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-allows.yaml,DEFAULT_GROUP'}]
2022-06-04 20:41:37.764 INFO 28144 --- [ main] com.cloud.gateway.GatewayApplication : No active profile set, falling back to 1 default profile: "default"
2022-06-04 20:41:38.210 INFO 28144 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
2022-06-04 20:41:38.211 INFO 28144 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
2022-06-04 20:41:38.225 INFO 28144 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 5 ms. Found 0 Redis repository interfaces.
2022-06-04 20:41:38.346 INFO 28144 --- [ main] o.s.cloud.context.scope.GenericScope : BeanFactory id=d6da96dc-ee00-3f1d-b951-2210fa3441c0
2022-06-04 20:41:38.356 INFO 28144 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'validatorConfiguration' of type [com.common.exception.validation.ValidatorConfiguration$$EnhancerBySpringCGLIB$$8078cc58] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2022-06-04 20:41:38.370 INFO 28144 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'validator' of type [org.hibernate.validator.internal.engine.ValidatorImpl] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2022-06-04 20:41:38.465 INFO 28144 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.client.loadbalancer.reactive.LoadBalancerBeanPostProcessorAutoConfiguration' of type [org.springframework.cloud.client.loadbalancer.reactive.LoadBalancerBeanPostProcessorAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2022-06-04 20:41:38.467 INFO 28144 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.client.loadbalancer.reactive.LoadBalancerBeanPostProcessorAutoConfiguration$ReactorDeferringLoadBalancerFilterConfig' of type [org.springframework.cloud.client.loadbalancer.reactive.LoadBalancerBeanPostProcessorAutoConfiguration$ReactorDeferringLoadBalancerFilterConfig] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2022-06-04 20:41:38.470 INFO 28144 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'reactorDeferringLoadBalancerExchangeFilterFunction' of type [org.springframework.cloud.client.loadbalancer.reactive.DeferringLoadBalancerExchangeFilterFunction] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2022-06-04 20:41:39.656 INFO 28144 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [After]
2022-06-04 20:41:39.656 INFO 28144 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Before]
2022-06-04 20:41:39.656 INFO 28144 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Between]
2022-06-04 20:41:39.656 INFO 28144 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Cookie]
2022-06-04 20:41:39.656 INFO 28144 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Header]
2022-06-04 20:41:39.656 INFO 28144 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Host]
2022-06-04 20:41:39.656 INFO 28144 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Method]
2022-06-04 20:41:39.656 INFO 28144 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Path]
2022-06-04 20:41:39.657 INFO 28144 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Query]
2022-06-04 20:41:39.657 INFO 28144 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [ReadBody]
2022-06-04 20:41:39.657 INFO 28144 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [RemoteAddr]
2022-06-04 20:41:39.657 INFO 28144 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [XForwardedRemoteAddr]
2022-06-04 20:41:39.657 INFO 28144 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Weight]
2022-06-04 20:41:39.657 INFO 28144 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [CloudFoundryRouteService]
2022-06-04 20:41:39.699 INFO 28144 --- [oundedElastic-1] com.alibaba.nacos.client.naming : initializer namespace from System Property :null
2022-06-04 20:41:39.699 INFO 28144 --- [oundedElastic-1] com.alibaba.nacos.client.naming : initializer namespace from System Environment :null
2022-06-04 20:41:39.699 INFO 28144 --- [oundedElastic-1] com.alibaba.nacos.client.naming : initializer namespace from System Property :null
2022-06-04 20:41:39.842 INFO 28144 --- [oundedElastic-3] com.alibaba.nacos.client.naming : new ips(1) service: [email protected]@user-center -> [{"instanceId":"192.168.1.108#9002#DEFAULT#[email protected]@user-center","ip":"192.168.1.108","port":9002,"weight":1.0,"healthy":true,"enabled":true,"ephemeral":true,"clusterName":"DEFAULT","serviceName":"[email protected]@user-center","metadata":{"preserved.register.source":"SPRING_CLOUD"},"instanceHeartBeatInterval":5000,"instanceHeartBeatTimeOut":15000,"ipDeleteTimeout":30000}]
2022-06-04 20:41:39.847 INFO 28144 --- [oundedElastic-3] com.alibaba.nacos.client.naming : current ips:(1) service: [email protected]@user-center -> [{"instanceId":"192.168.1.108#9002#DEFAULT#[email protected]@user-center","ip":"192.168.1.108","port":9002,"weight":1.0,"healthy":true,"enabled":true,"ephemeral":true,"clusterName":"DEFAULT","serviceName":"[email protected]@user-center","metadata":{"preserved.register.source":"SPRING_CLOUD"},"instanceHeartBeatInterval":5000,"instanceHeartBeatTimeOut":15000,"ipDeleteTimeout":30000}]
2022-06-04 20:43:43.034 WARN 28144 --- [.naming.updater] com.alibaba.nacos.client.naming : out of date data received, old-t: 1654346563261, new-t: 0
日志图片:
解决方案:
1.修改配置
由于配置了spring.cloud.gateway.discovery.locator.enabled = true导致,改为false或者去掉该配置,因为默认为false,但是该方案会导致动态路由不能加载,影响微服务调用。
gateway:
discovery:
locator:
enabled: false
2.feign注入使用懒加载方式
// 关键:这里必须使用@Lazy
@Lazy
@Autowired
private Oauth2Client oauth2Client;
相关大数据学习demo地址:
https://github.com/carteryh/big-data
边栏推荐
- Space transcriptome experiment | what factors will affect the quality of space transcriptome sequencing during the preparation of clinical tissue samples?
- Log in with password and exit with error for three times.
- Date of SQL optimization_ Format() function
- Simulate Oracle lock waiting and manual unlocking
- Yintai department store and Taobao tmall jointly create a green fashion show to help "carbon neutrality"
- [Monday commuter radio station] cron expression. It's enough to read this article
- 【数据可视化】Apache Superset 1.2.0教程 (三)—— 图表功能详解
- Frequency domain filter
- The e-sports Internet cafe uses a 2.5G network card to experience the feeling of flying!
- Modify appid of local wechat applet
猜你喜欢

Cuckoo Hash

UDP、TCP

全球机器视觉市场规模持续上涨,PoE图像采集卡为工业相机提供高速传输通道

9 r remove missing values

Simulate Oracle lock waiting and manual unlocking

Final examination of theory and practice of socialism with Chinese characteristics 1

Docker installing MySQL

12 date and time in R

Online excel file parsing and conversion to JSON format
Recompile kubeadm to solve the problem of certificate expiration in one year
随机推荐
On scale of canvas recttransform in ugui
JMeter load test finds the maximum number of concurrent users (including step analysis)
[data visualization] use Apache superset to visualize Clickhouse data
Chrome V8 source code 48 The secret of weak type addition,'+'source code analysis
Frequency domain filter
技术交流|网络安全设备为什么要用Bypass功能
In idea, run the yarn command to show that the file cannot be loaded because running scripts is disabled on this system
[nk] 牛客练习赛100 C 小红的删数字
Implement AOP and interface caching on WPF client
Application analysis of Poe image acquisition card in machine vision industrial computer
Yintai department store and Taobao tmall jointly create a green fashion show to help "carbon neutrality"
JSON introduction
Summary of C language programming knowledge points 01
2022-2028 global and Chinese thermal power generation (TEG) module market status and future development trend
桌面以及文件资源管理器无限重启的解决
php pcntl_fork 创建多个子进程解析
Final examination of Dialectics of nature 1
Pyqt5 technical part - set the default value of qcombobox drop-down box and get the current selection of the drop-down box
Redis fourth session - redis high performance principle (multiplexing) and high availability analysis (backup, master-slave)
vectorDrawable使用报错