I noticed that it is possible to add routes via Spring cloud Config (or by changing the yml directly), but it is not possible to remove routes.

Scenario: - routed defined:

zuul:
ignored-services: "*"
  routes:
    echo3:
      path: /echo3/**
      url: http://www.aaa.com
  • route shows fine in /admin/routes
  • remove route from yml
  • hit /admin/refresh() endpoint. The response mentions that changes were detected about the route
  • Problem: /admin/routes still shows the route

Comment From: aivans

see this: https://github.com/spring-cloud/spring-cloud-netflix/issues/706#issuecomment-163870612

Comment From: bijukunjummen

I have analyzed this issue to an extent now -

  1. There is a bug in ZuulProperties where new Zuul route properties lead to routes fields being modified correctly but the one's which are removed don't appear to be reflected in the routes field.
  2. With the previous issue fixed, ZuulHandlerMapping still has an issue where it is able to add new path handlers based on ZuulProperties but not able to remove them.

Will attempt a PR which fixes these two issues.

Comment From: bijukunjummen

@spencergibb, @dsyer , on checking a little more I think this is a broader issue with ConfigurationPropertiesRebinder and not just with ZuulProperties, any removed property is not accounted for as the ConfigurationProperties bean is retrieved in place and re-bound, the existing properties remain as is. I feel that just as in the PR https://github.com/spring-cloud/spring-cloud-netflix/issues/2158, adding a @RefreshScope is a cleaner fix to this specific issue.

Comment From: arebya

Any new comments on this issue ? @spencergibb, @dsyer, @bijukunjummen

Comment From: OlgaMaciaszek

Closing the issue, since Zuul is not supported by Spring Cloud anymore.