Spring-cloud-netflix: issue : setting random port for eureka client within a scope

Created on 25 May 2017  路  3Comments  路  Source: spring-cloud/spring-cloud-netflix

when i try to set eureka client port like below
server:
port: ${random.int[9090,9099]}

but eureka sever get error registered ports

Most helpful comment

random.int issues a new value every time it is read (or every time a property with a placeholder is read. It is not something we plan to support. setting the port to 0 lets the container/os determine the port.

All 3 comments

I just created a Eureka client app and set server.port to ${random.int[9090,9099]} and the client started up fine. Can you provide more details on how to reproduce the problem or provide a sample application?

used version as below :
springBootVersion = '1.5.2.RELEASE'
mavenBom ':spring-cloud-dependencies:Dalston.RELEASE'
compile ':spring-cloud-starter-eureka'

From the console screenshot, we can find that it used different ports, but only the server ports is used actually, and also eureka server got an error registered port. but i tried use zero to set a random, everything works fine.

ss

random.int issues a new value every time it is read (or every time a property with a placeholder is read. It is not something we plan to support. setting the port to 0 lets the container/os determine the port.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sprgn picture sprgn  路  3Comments

jjparsons picture jjparsons  路  3Comments

jabrena picture jabrena  路  4Comments

Alvise88 picture Alvise88  路  3Comments

marcingrzejszczak picture marcingrzejszczak  路  4Comments