Currently Spring Cloud have a number of endpoints that use a legacy name (for example hystrix.stream). They would like to give users the opportunity to migrate to the new name whilst still supporting the old one.

Ideally this would mean that endpoint references in properties can be referred to by either name, and that several mappings would be setup.

For example, hystrix.stream would be mapped to /hystrix.stream and /hystrixstream

Comment From: ryanjbaxter

It would be nice if this could make it into the 2.1.x stream as well

Comment From: philwebb

I don't think that's possible, it's almost certainly going to involve some fairly risky changes and it definitely feels like an enhancement rather than a bug.

Comment From: spencergibb

I'm ok if it's 2.2.

This is the definition of hystrix endpoint

@ServletEndpoint(id = "hystrix.stream")

and

@RestControllerEndpoint(id = "hystrix.stream")

In commons the other is

@Endpoint(id = "service-registry")

Comment From: ryanjbaxter

@philwebb can't blame me for trying ;)

@spencergibb there is also a WebFlux implementation that is using @RestControllerEndpoint

Comment From: philwebb

I've spent the morning looking into this and it's going to be very difficult to support multiple paths for the same endpoint. We'd need to rework the Spring MVC, WebFlux and Jersey mappers and the security support. We'd also need to find a way to do that in a back compatible way.

I think we need to consider a different approach.

Comment From: spencergibb

I think we need to consider a different approach.

Such as?

Comment From: philwebb

One idea might be to offer a property that the user can set to transparently migrate legacy names. The experience would be that they start the app and see a warning about the use of "hystrix.stream" but also get told they can set management.endpoints.migrate-legacy-names if they want to.

If they set that property to true and restart the app then they the endpoint ID transparently changes to "hystrix.stream". Perhaps we could even set that property by default and make people opt-in to the old names if they can't make the switch easily?

Comment From: philwebb

We spoke about this today and decided that as long as the existing IDs continue to work there's not need to support multiple path mappings. I've repurposed this issue to add migration support to allow Spring Cloud users to get ahead of the curve and pro-actively migrate if they wish.

Comment From: philwebb

@spencergibb @ryanjbaxter I've added a management.endpoints.migrate-legacy-ids property that can be set to true to transparently remove .'s from the endpoint ID. I'm not going to add much documentation for this in Spring Boot, but you can suggest Spring Cloud users switch it on if they want to get ahead of the curve.

Comment From: philippn

Unfortunately, the switch management.endpoints.migrate-legacy-ids does not help with the warning in Spring Cloud, because it removes only dots. However, the service id that is causing the warning in Spring Cloud contains a dash (service-registry).

Comment From: wilkinsona

@philippn That sounds like an omission in the support for migrating legacy IDs. Can you please open a new issue so that we can take a closer look?

Comment From: philippn

@wilkinsona Thanks for your response! I have added #20703 accordingly.