Cloudfoundry UUID-Url in Eureka

297 views Asked by At

When I register an app to my Eureka on CloudFoundry, it registers itself with a UUID-style address (e.g. https://8d071e0e-681c-4218-8575-56d65ada36f3:443/). What kind of address is this? Sadly it can't be reached by other apps on cf, using this kind of address.

1

There are 1 answers

0
Fabian Kleiser On

You need to add the following configuration to your Spring application.yml:

spring:
  application:
    name: my-spring-application

eureka:
  client:
    serviceUrl:
      defaultZone: http://eureka-server.local.pcfdev.io/eureka/
  instance:
    hostname: ${vcap.application.uris[0]:localhost}
    nonSecurePort: 80

This will register all instances of the app with the application URL to Eureka. Hence, the Cloud Foundry router always takes care of load balancing between app instances. Refer to the documentation for more information about the options you have here.