I have try to setup Https for netflix eureka, zuul & backend spring services. All working well individually and all services can be register in Https eureka server. However, the rounting from zuul using serviceId was not working as expected. The details are as follows:
Eureka server:
Zuul:
spring services:
When I try to call springs services end point through zuul (e.g. https://localhost:8002/codemaint/country/listData) , according to zuul log, the end point seems resolved successully,
zuul log:
2022-02-07 23:10:36.646 DEBUG 22520 --- [io-8002-exec-10] o.s.web.client.RestTemplate : HTTP POST https://localhost:9002/oauth/check_token?Data-Uniform-Format-Flag=N 2022-02-07 23:10:36.646 DEBUG 22520 --- [io-8002-exec-10] o.s.web.client.RestTemplate : Accept=[application/json, application/+json] 2022-02-07 23:10:36.646 DEBUG 22520 --- [io-8002-exec-10] o.s.web.client.RestTemplate : Writing [{token=[b9ff6fd6-ba15-42f3-a6e1-c9dc71c4cbf2]}] as "application/x-www-form-urlencoded" 2022-02-07 23:10:36.734 DEBUG 22520 --- [io-8002-exec-10] o.s.web.client.RestTemplate : Response 200 OK 2022-02-07 23:10:36.736 DEBUG 22520 --- [io-8002-exec-10] o.s.web.client.RestTemplate : Reading to [java.util.Map<?, ?>] 2022-02-07 23:10:36.768 DEBUG 22520 --- [io-8002-exec-10] o.s.web.servlet.DispatcherServlet : POST "/codemaint/country/listData?pageNo=1&pageSize=20&debug=true", parameters={masked} 2022-02-07 23:10:36.818 INFO 22520 --- [io-8002-exec-10] c.b.e.g.filter.ZuulLoggingFilter : request -> org.springframework.cloud.netflix.zuul.filters.pre.Servlet30RequestWrapper@7502007a request uri-> /codemaint/country/listData 2022-02-07 23:10:37.008 INFO 22520 --- [io-8002-exec-10] c.netflix.config.ChainedDynamicProperty : Flipping property: codemaint.ribbon.ActiveConnectionsLimit to use NEXT property: niws.loadbalancer.availabilityFilteringRule.activeConnectionsLimit = 2147483647 2022-02-07 23:10:37.037 INFO 22520 --- [io-8002-exec-10] c.n.u.concurrent.ShutdownEnabledTimer : Shutdown hook installed for: NFLoadBalancer-PingTimer-codemaint 2022-02-07 23:10:37.037 INFO 22520 --- [io-8002-exec-10] c.netflix.loadbalancer.BaseLoadBalancer : Client: codemaint instantiated a LoadBalancer: DynamicServerListLoadBalancer:{NFLoadBalancer:name=codemaint,current list of Servers=[],Load balancer stats=Zone stats: {},Server stats: []}ServerList:null 2022-02-07 23:10:37.044 INFO 22520 --- [io-8002-exec-10] c.n.l.DynamicServerListLoadBalancer : Using serverListUpdater PollingServerListUpdater 2022-02-07 23:10:37.072 INFO 22520 --- [io-8002-exec-10] c.netflix.config.ChainedDynamicProperty : Flipping property: codemaint.ribbon.ActiveConnectionsLimit to use NEXT property: niws.loadbalancer.availabilityFilteringRule.activeConnectionsLimit = 2147483647 2022-02-07 23:10:37.075 INFO 22520 --- [io-8002-exec-10] c.n.l.DynamicServerListLoadBalancer : DynamicServerListLoadBalancer for client codemaint initialized: DynamicServerListLoadBalancer:{NFLoadBalancer:name=codemaint,current list of Servers=[192.168.201.7:9001*],Load balancer stats=Zone stats: {defaultzone=[Zone:defaultzone; Instance count:1; Active connections count: 0; Circuit breaker tripped count: 0; Active connections per server: 0.0;] },Server stats: [[Server:192.168.201.7:9001; Zone:defaultZone; Total Requests:0; Successive connection failure:0; Total blackout seconds:0; Last connection made:Thu Jan 01 07:30:00 SGT 1970; First connection made: Thu Jan 01 07:30:00 SGT 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.netflix.ribbon.eureka.DomainExtractingServerList@2e7c28d9 2022-02-07 23:10:37.447 DEBUG 22520 --- [io-8002-exec-10] o.s.web.servlet.DispatcherServlet : Completed 200 OK
however, the response was always
{ "code": 999, "message": "Service unavailable:Service exception" }
I tried to replace the serviceId with URL https://localhost:9001, it works as expected.
Is it still an issue in zuul? we need serviceId for load balancing and how can I debug this exception?
Comment From: ksloo1788
Yes. It doesn't work in version 2.2.10.RELEASE. loadBalancerClient.choose("common-service") also return null.
Comment From: neonlai
Yes. It doesn't work in version 2.2.10.RELEASE. loadBalancerClient.choose("common-service") also return null. @ksloo1788 Is latest spring cloud Netflix version working with serviceId routing with https ? Any workaround?
Comment From: OlgaMaciaszek
Hello, @neonlai Zuul is no longer supported. Please use Spring Cloud Gateway instead. If the problem persists after migration, please open a new GH issue.