код
Официальный образец.
сообщение об ошибке
---
2020-02-17 22:26:40.885 INFO 19432 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring FrameworkServlet 'dispatcherServlet'
2020-02-17 22:26:40.885 INFO 19432 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization started
2020-02-17 22:26:40.904 INFO 19432 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization completed in 19 ms
2020-02-17 22:26:40.977 INFO 19432 --- [nio-8080-exec-1] s.c.a.AnnotationConfigApplicationContext : Refreshing SpringClientFactory-service-provider: startup date [Mon Feb 17 22:26:40 CST 2020]; parent: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@68759011
2020-02-17 22:26:41.085 INFO 19432 --- [nio-8080-exec-1] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2020-02-17 22:26:41.627 INFO 19432 --- [nio-8080-exec-1] c.netflix.config.ChainedDynamicProperty : Flipping property: service-provider.ribbon.ActiveConnectionsLimit to use NEXT property: niws.loadbalancer.availabilityFilteringRule.activeConnectionsLimit = 2147483647
2020-02-17 22:26:41.693 INFO 19432 --- [nio-8080-exec-1] c.netflix.loadbalancer.BaseLoadBalancer : Client: service-provider instantiated a LoadBalancer: DynamicServerListLoadBalancer:{NFLoadBalancer:name=service-provider,current list of Servers=[],Load balancer stats=Zone stats: {},Server stats: []}ServerList:null
2020-02-17 22:26:41.703 INFO 19432 --- [nio-8080-exec-1] c.n.l.DynamicServerListLoadBalancer : Using serverListUpdater PollingServerListUpdater
2020-02-17 22:26:41.729 INFO 19432 --- [nio-8080-exec-1] c.netflix.config.ChainedDynamicProperty : Flipping property: service-provider.ribbon.ActiveConnectionsLimit to use NEXT property: niws.loadbalancer.availabilityFilteringRule.activeConnectionsLimit = 2147483647
2020-02-17 22:26:41.732 INFO 19432 --- [nio-8080-exec-1] c.n.l.DynamicServerListLoadBalancer : DynamicServerListLoadBalancer for client service-provider initialized: DynamicServerListLoadBalancer:{NFLoadBalancer:name=service-provider,current list of Servers=[192.168.168.104:8070],Load balancer stats=Zone stats: {unknown=[Zone:unknown; Instance count:1; Active connections count: 0; Circuit breaker tripped count: 0; Active connections per server: 0.0;]
},Server stats: [[Server:192.168.168.104:8070; Zone:UNKNOWN; Total Requests:0; Successive connection failure:0; Total blackout seconds:0; Last connection made:Thu Jan 01 08:00:00 CST 1970; First connection made: Thu Jan 01 08:00:00 CST 1970; Active Connections:0; total failure count in last (1000) msecs:0; average resp time:0.0; 90 percentile resp time:0.0; 95 percentile resp time:0.0; min resp time:0.0; max resp time:0.0; stddev resp time:0.0]
]}ServerList:org.springframework.cloud.alibaba.nacos.ribbon.NacosServerList@59069bb
2020-02-17 22:26:42.709 INFO 19432 --- [erListUpdater-0] c.netflix.config.ChainedDynamicProperty : Flipping property: service-provider.ribbon.ActiveConnectionsLimit to use NEXT property: niws.loadbalancer.availabilityFilteringRule.activeConnectionsLimit = 2147483647
2020-02-17 22:26:47.665 ERROR 19432 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://service-provider/echo/2018": Unexpected end of file from server; nested exception is java.net.SocketException: Unexpected end of file from server] with root cause
java.net.SocketException: Unexpected end of file from server
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:851) ~[na:1.8.0_181]
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:678) ~[na:1.8.0_181]
客户端.消费服务();
причина
Сервер принял запрос, но не ответил.
Точки останова поставщика услуг не введены.
Решение
Служба успешно зарегистрирована?
Регистрация прошла успешно.
gongzhihaodeMacBook-Pro:bin gongzhihao$ curl -X GET 'http://127.0.0.1:8848/nacos/v1/ns/instance/list?serviceName=service-provider'
{"metadata":{},"dom":"service-provider","cacheMillis":3000,"useSpecifiedURL":false,"hosts":[{"valid":true,"marked":false,"metadata":{"preserved.register.source":"SPRING_CLOUD"},"instanceId":"192.168.168.104#8070#DEFAULT#DEFAULT_GROUP@@service-provider","port":8070,"healthy":true,"ip":"192.168.168.104","clusterName":"DEFAULT","weight":1.0,"ephemeral":true,"serviceName":"service-provider","enabled":true}],"name":"DEFAULT_GROUP@@service-provider","checksum":"b5496b2873f99063790bcd072035e1d1","lastRefTime":1581991209270,"env":"","clusters":""}gongzhihaodeMacBook-Pro:bin gongzhihao$