Skip to content

eureka client instance registers incorrectly if 'server.port' is set to 0 #570

@kdvolder

Description

@kdvolder

I created basic service that registers itself with a local Eureka server. The application .yml of my client looks like this:

server:
  port: 8001
spring:
  application:
    name: date-service
eureka:
  client:
    service-url:
      defaultZone: http://localhost:8761/eureka/

That works.

When I change 'server.port' to '0' so the port is chosen dynamically then the service doesn't appear to register itself correctly anymore. (It still registers, but with the wrong port, 80).

Being able to use dynamic port would be nice, if one wants to run multiple instances of a service locally without having to create multiple configurations of it (i.e. just relaunch the same thing a few times and have each running instance dynamically pick a port).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions