Pivotal Cloud Foundry Support

 View Only

 Spring boot app running on pcf could not find the new route mapped to app after the app has been started.

Rajeshwar G's profile image
Rajeshwar G posted Jul 24, 2020 08:49 AM
  1. I have pushed an app abc to pcf, and when it starts up it has a route abc-green.example.com. This app registers itself to eureka service registry (not the market place service), with the route abc-green.example.com.
  2. I have mapped a new route to this app abc.example.com when it is running.
  3. unmapped the initial route abc-green.example.com.
  4. Eureka still has the old route. abc-green.example.com. Due to this all the requests routed to this app via abc-green.example.com are failing.

 

When I tried to fetch the env properties via actuator or CloudFoundry Connectors, I could still see the vcap.application.application_uris having only one route, which is stale.

 

I can restart the app and this new route will be registered with eureka. But is there a way to feed this new url into the app without restart, so that eureka will have latest info?

 

Daniel Mikusa's profile image
Daniel Mikusa

What you're seeing is expected behavior. I'm not 100% sure this will work, but it would be worth trying the Actuator Refresh endpoint to see if that will refresh and update the routes in the registry.

 

This is something that you can use with Config server, hence it's in the Config server docs, but you might be able to use the Actuator refresh endpoint in this case as well. It seems worth a shot.

 

https://docs.pivotal.io/spring-cloud-services/3-1/common/config-server/writing-client-applications.html#refresh-client-application-configuration

 

Hope that helps!