Zuul fails to route with dynamic port microservice










0















I have microservice with a dynamic port i.e, server.port=0.
The microservice is getting registered fine at eureka and it is up and running.



However when I am trying to access it via Zuul gateway, it fails to do with the below logs in my zuul gateway.



c.netflix.loadbalancer.BaseLoadBalancer : Client: book instantiated a LoadBalancer: DynamicServerListLoadBalancer:NFLoadBalancer:name=book,current list of Servers=,Load balancer stats=Zone stats: ,Server stats: ServerList:null
c.n.l.DynamicServerListLoadBalancer : Using serverListUpdater PollingServerListUpdater
c.netflix.config.ChainedDynamicProperty : Flipping property: book.ribbon.ActiveConnectionsLimit to use NEXT property: niws.loadbalancer.availabilityFilteringRule.activeConnectionsLimit = 2147483647
c.n.l.DynamicServerListLoadBalancer : DynamicServerListLoadBalancer for client book initialized: DynamicServerListLoadBalancer:NFLoadBalancer:name=book,current list of Servers=[192.168.60.1:0],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.60.1:0; Zone:defaultZone; Total Requests:0; Successive connection failure:0; Total blackout seconds:0; Last connection made:Thu Jan 01 05:30:00 IST 1970; First connection made: Thu Jan 01 05:30:00 IST 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@4dbc2e52


However when I change the port of my microservice (book) to non dynamic one server.port = 8081, everything runs fine and each time I have to restart the zuul application as well.
I guess it does not go well when one of the microservice changes port.



Let me share the application.yml content of both the files.




Microservice (book), application.yml




spring:
application:
name: book

server:
port: 0 # I change it between 0 and 8081 (8081 works like a charm)

eureka:
client:
service-url:
defaultZone: $EUREKA_URI:http://localhost:8761/eureka
instance:
prefer-ip-address: true



Zuul application.yml




server:
port: 8080
spring:
application:
name: gatekeeper

zuul:
routes:
book:
serviceId: book

#Added it so as to increase the timeout for the underlying hysterix of the zuul

hystrix:
command:
default:
execution:
isolation:
strategy: THREAD
thread:
timeoutInMilliseconds: 60000



Eureka server application.yml




server:
port: 8761

eureka:
client:
register-with-eureka: false
fetch-registry: false



Sring cloud version is dynamic ($spring-cloud.version) with boot
2.1.0.release.











share|improve this question
























  • Out of interest, what address & port does the Eureka UI show for the service when using 0. Is it literally 0. Which version of spring cloud are you using. This thread might help: github.com/spring-cloud/spring-cloud-netflix/issues/570 although it looks like even as recently as last month this setup was still causing issues: github.com/spring-cloud/spring-cloud-netflix/issues/2732

    – David Goate
    Nov 14 '18 at 8:40












  • when you keep the port 0, then a random port which is free gets allocated to the service. e.g: Now it is running with port 51995

    – bibliophilsagar
    Nov 14 '18 at 9:21











  • Though Eureka shows 0

    – bibliophilsagar
    Nov 14 '18 at 9:22















0















I have microservice with a dynamic port i.e, server.port=0.
The microservice is getting registered fine at eureka and it is up and running.



However when I am trying to access it via Zuul gateway, it fails to do with the below logs in my zuul gateway.



c.netflix.loadbalancer.BaseLoadBalancer : Client: book instantiated a LoadBalancer: DynamicServerListLoadBalancer:NFLoadBalancer:name=book,current list of Servers=,Load balancer stats=Zone stats: ,Server stats: ServerList:null
c.n.l.DynamicServerListLoadBalancer : Using serverListUpdater PollingServerListUpdater
c.netflix.config.ChainedDynamicProperty : Flipping property: book.ribbon.ActiveConnectionsLimit to use NEXT property: niws.loadbalancer.availabilityFilteringRule.activeConnectionsLimit = 2147483647
c.n.l.DynamicServerListLoadBalancer : DynamicServerListLoadBalancer for client book initialized: DynamicServerListLoadBalancer:NFLoadBalancer:name=book,current list of Servers=[192.168.60.1:0],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.60.1:0; Zone:defaultZone; Total Requests:0; Successive connection failure:0; Total blackout seconds:0; Last connection made:Thu Jan 01 05:30:00 IST 1970; First connection made: Thu Jan 01 05:30:00 IST 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@4dbc2e52


However when I change the port of my microservice (book) to non dynamic one server.port = 8081, everything runs fine and each time I have to restart the zuul application as well.
I guess it does not go well when one of the microservice changes port.



Let me share the application.yml content of both the files.




Microservice (book), application.yml




spring:
application:
name: book

server:
port: 0 # I change it between 0 and 8081 (8081 works like a charm)

eureka:
client:
service-url:
defaultZone: $EUREKA_URI:http://localhost:8761/eureka
instance:
prefer-ip-address: true



Zuul application.yml




server:
port: 8080
spring:
application:
name: gatekeeper

zuul:
routes:
book:
serviceId: book

#Added it so as to increase the timeout for the underlying hysterix of the zuul

hystrix:
command:
default:
execution:
isolation:
strategy: THREAD
thread:
timeoutInMilliseconds: 60000



Eureka server application.yml




server:
port: 8761

eureka:
client:
register-with-eureka: false
fetch-registry: false



Sring cloud version is dynamic ($spring-cloud.version) with boot
2.1.0.release.











share|improve this question
























  • Out of interest, what address & port does the Eureka UI show for the service when using 0. Is it literally 0. Which version of spring cloud are you using. This thread might help: github.com/spring-cloud/spring-cloud-netflix/issues/570 although it looks like even as recently as last month this setup was still causing issues: github.com/spring-cloud/spring-cloud-netflix/issues/2732

    – David Goate
    Nov 14 '18 at 8:40












  • when you keep the port 0, then a random port which is free gets allocated to the service. e.g: Now it is running with port 51995

    – bibliophilsagar
    Nov 14 '18 at 9:21











  • Though Eureka shows 0

    – bibliophilsagar
    Nov 14 '18 at 9:22













0












0








0








I have microservice with a dynamic port i.e, server.port=0.
The microservice is getting registered fine at eureka and it is up and running.



However when I am trying to access it via Zuul gateway, it fails to do with the below logs in my zuul gateway.



c.netflix.loadbalancer.BaseLoadBalancer : Client: book instantiated a LoadBalancer: DynamicServerListLoadBalancer:NFLoadBalancer:name=book,current list of Servers=,Load balancer stats=Zone stats: ,Server stats: ServerList:null
c.n.l.DynamicServerListLoadBalancer : Using serverListUpdater PollingServerListUpdater
c.netflix.config.ChainedDynamicProperty : Flipping property: book.ribbon.ActiveConnectionsLimit to use NEXT property: niws.loadbalancer.availabilityFilteringRule.activeConnectionsLimit = 2147483647
c.n.l.DynamicServerListLoadBalancer : DynamicServerListLoadBalancer for client book initialized: DynamicServerListLoadBalancer:NFLoadBalancer:name=book,current list of Servers=[192.168.60.1:0],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.60.1:0; Zone:defaultZone; Total Requests:0; Successive connection failure:0; Total blackout seconds:0; Last connection made:Thu Jan 01 05:30:00 IST 1970; First connection made: Thu Jan 01 05:30:00 IST 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@4dbc2e52


However when I change the port of my microservice (book) to non dynamic one server.port = 8081, everything runs fine and each time I have to restart the zuul application as well.
I guess it does not go well when one of the microservice changes port.



Let me share the application.yml content of both the files.




Microservice (book), application.yml




spring:
application:
name: book

server:
port: 0 # I change it between 0 and 8081 (8081 works like a charm)

eureka:
client:
service-url:
defaultZone: $EUREKA_URI:http://localhost:8761/eureka
instance:
prefer-ip-address: true



Zuul application.yml




server:
port: 8080
spring:
application:
name: gatekeeper

zuul:
routes:
book:
serviceId: book

#Added it so as to increase the timeout for the underlying hysterix of the zuul

hystrix:
command:
default:
execution:
isolation:
strategy: THREAD
thread:
timeoutInMilliseconds: 60000



Eureka server application.yml




server:
port: 8761

eureka:
client:
register-with-eureka: false
fetch-registry: false



Sring cloud version is dynamic ($spring-cloud.version) with boot
2.1.0.release.











share|improve this question
















I have microservice with a dynamic port i.e, server.port=0.
The microservice is getting registered fine at eureka and it is up and running.



However when I am trying to access it via Zuul gateway, it fails to do with the below logs in my zuul gateway.



c.netflix.loadbalancer.BaseLoadBalancer : Client: book instantiated a LoadBalancer: DynamicServerListLoadBalancer:NFLoadBalancer:name=book,current list of Servers=,Load balancer stats=Zone stats: ,Server stats: ServerList:null
c.n.l.DynamicServerListLoadBalancer : Using serverListUpdater PollingServerListUpdater
c.netflix.config.ChainedDynamicProperty : Flipping property: book.ribbon.ActiveConnectionsLimit to use NEXT property: niws.loadbalancer.availabilityFilteringRule.activeConnectionsLimit = 2147483647
c.n.l.DynamicServerListLoadBalancer : DynamicServerListLoadBalancer for client book initialized: DynamicServerListLoadBalancer:NFLoadBalancer:name=book,current list of Servers=[192.168.60.1:0],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.60.1:0; Zone:defaultZone; Total Requests:0; Successive connection failure:0; Total blackout seconds:0; Last connection made:Thu Jan 01 05:30:00 IST 1970; First connection made: Thu Jan 01 05:30:00 IST 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@4dbc2e52


However when I change the port of my microservice (book) to non dynamic one server.port = 8081, everything runs fine and each time I have to restart the zuul application as well.
I guess it does not go well when one of the microservice changes port.



Let me share the application.yml content of both the files.




Microservice (book), application.yml




spring:
application:
name: book

server:
port: 0 # I change it between 0 and 8081 (8081 works like a charm)

eureka:
client:
service-url:
defaultZone: $EUREKA_URI:http://localhost:8761/eureka
instance:
prefer-ip-address: true



Zuul application.yml




server:
port: 8080
spring:
application:
name: gatekeeper

zuul:
routes:
book:
serviceId: book

#Added it so as to increase the timeout for the underlying hysterix of the zuul

hystrix:
command:
default:
execution:
isolation:
strategy: THREAD
thread:
timeoutInMilliseconds: 60000



Eureka server application.yml




server:
port: 8761

eureka:
client:
register-with-eureka: false
fetch-registry: false



Sring cloud version is dynamic ($spring-cloud.version) with boot
2.1.0.release.








java spring-boot microservices netflix-eureka netflix-zuul






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 14 '18 at 9:27







bibliophilsagar

















asked Nov 13 '18 at 11:27









bibliophilsagarbibliophilsagar

1,165824




1,165824












  • Out of interest, what address & port does the Eureka UI show for the service when using 0. Is it literally 0. Which version of spring cloud are you using. This thread might help: github.com/spring-cloud/spring-cloud-netflix/issues/570 although it looks like even as recently as last month this setup was still causing issues: github.com/spring-cloud/spring-cloud-netflix/issues/2732

    – David Goate
    Nov 14 '18 at 8:40












  • when you keep the port 0, then a random port which is free gets allocated to the service. e.g: Now it is running with port 51995

    – bibliophilsagar
    Nov 14 '18 at 9:21











  • Though Eureka shows 0

    – bibliophilsagar
    Nov 14 '18 at 9:22

















  • Out of interest, what address & port does the Eureka UI show for the service when using 0. Is it literally 0. Which version of spring cloud are you using. This thread might help: github.com/spring-cloud/spring-cloud-netflix/issues/570 although it looks like even as recently as last month this setup was still causing issues: github.com/spring-cloud/spring-cloud-netflix/issues/2732

    – David Goate
    Nov 14 '18 at 8:40












  • when you keep the port 0, then a random port which is free gets allocated to the service. e.g: Now it is running with port 51995

    – bibliophilsagar
    Nov 14 '18 at 9:21











  • Though Eureka shows 0

    – bibliophilsagar
    Nov 14 '18 at 9:22
















Out of interest, what address & port does the Eureka UI show for the service when using 0. Is it literally 0. Which version of spring cloud are you using. This thread might help: github.com/spring-cloud/spring-cloud-netflix/issues/570 although it looks like even as recently as last month this setup was still causing issues: github.com/spring-cloud/spring-cloud-netflix/issues/2732

– David Goate
Nov 14 '18 at 8:40






Out of interest, what address & port does the Eureka UI show for the service when using 0. Is it literally 0. Which version of spring cloud are you using. This thread might help: github.com/spring-cloud/spring-cloud-netflix/issues/570 although it looks like even as recently as last month this setup was still causing issues: github.com/spring-cloud/spring-cloud-netflix/issues/2732

– David Goate
Nov 14 '18 at 8:40














when you keep the port 0, then a random port which is free gets allocated to the service. e.g: Now it is running with port 51995

– bibliophilsagar
Nov 14 '18 at 9:21





when you keep the port 0, then a random port which is free gets allocated to the service. e.g: Now it is running with port 51995

– bibliophilsagar
Nov 14 '18 at 9:21













Though Eureka shows 0

– bibliophilsagar
Nov 14 '18 at 9:22





Though Eureka shows 0

– bibliophilsagar
Nov 14 '18 at 9:22












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53280034%2fzuul-fails-to-route-with-dynamic-port-microservice%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53280034%2fzuul-fails-to-route-with-dynamic-port-microservice%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Top Tejano songwriter Luis Silva dead of heart attack at 64

政党

天津地下鉄3号線