4

I would like to replace the existing RibbonRoutingFilter that is embedded in the zuul package with a custom one that has additional characteristics/customizations.

Is it just a case of creating my own and giving it is priority that triggers ahead of the builtin one? I don't want this to be called twice.

Actually to clarify the last point, I want my version to supersede the builtin one. I created a copy of RibbonRoutingFilter, added my customizations and it works the way I want, but the original RibbonRoutingFilter is also called. How do I suppress it or is that possible.

Suggestions? Thanks in advance

g00glen00b
  • 41,995
  • 13
  • 95
  • 133
EvilJinious1
  • 2,773
  • 6
  • 43
  • 63

1 Answers1

6

You can disable filters. To disable the RibbonRoutingFilter set zuul.RibbonRoutingFilter.route.disable=true. Then create your own.

spencergibb
  • 24,471
  • 6
  • 69
  • 75
  • 1
    I would like to know when is RibbonRoutingFilter enabled and when is SimpleHostRoutingFilter enabled? How can I detect what is default? – Ignacio Ocampo Jan 07 '17 at 08:43
  • serviceId -> ribbon, URL -> simple host – spencergibb Jan 07 '17 at 10:34
  • The link https://github.com/spring-cloud/spring-cloud-netflix/blob/master/docs/src/main/asciidoc/spring-cloud-netflix.adoc#disable-zuul-filters in the answer doesn't talk about disabling filters. – user674669 Aug 31 '20 at 22:24
  • The link that's workig today is https://cloud.spring.io/spring-cloud-static/Edgware.SR6/multi/multi__router_and_filter_zuul.html. The Section is 19.11 Disable Zuul Filters. It says: "Zuul for Spring Cloud comes with a number of ZuulFilter beans enabled by default in both proxy and server mode. See the zuul filters package for the possible filters that are enabled. If you want to disable one, simply set zuul...disable=true. By convention, the package after filters is the Zuul filter type. ..." – user674669 Aug 31 '20 at 23:06
  • Edgware is long been end of life. This is the most up to date docs https://docs.spring.io/spring-cloud-netflix/docs/2.2.x/reference/html/#disable-zuul-filters. The 2.2.x line of spring-cloud-netflix will be the last to include zuul, so `current`, `master` or anything `3.x` will not work. – spencergibb Sep 01 '20 at 23:08