Commit 4e5a3f4f by Alykoff Committed by Ryan Baxter

Add ConditionalOnMissingBean for beans (#2957)

Added `@ConditionalOnMissingBean` for `PreDecorationFilter`, `RibbonRoutingFilter` beans in `org.springframework.cloud.netflix.zuul.ZuulProxyAutoConfiguration` class.
parent dcebcdb6
......@@ -94,6 +94,7 @@ public class ZuulProxyAutoConfiguration extends ZuulServerAutoConfiguration {
// pre filters
@Bean
@ConditionalOnMissingBean(PreDecorationFilter.class)
public PreDecorationFilter preDecorationFilter(RouteLocator routeLocator, ProxyRequestHelper proxyRequestHelper) {
return new PreDecorationFilter(routeLocator, this.server.getServlet().getServletPrefix(), this.zuulProperties,
proxyRequestHelper);
......@@ -101,6 +102,7 @@ public class ZuulProxyAutoConfiguration extends ZuulServerAutoConfiguration {
// route filters
@Bean
@ConditionalOnMissingBean(RibbonRoutingFilter.class)
public RibbonRoutingFilter ribbonRoutingFilter(ProxyRequestHelper helper,
RibbonCommandFactory<?> ribbonCommandFactory) {
RibbonRoutingFilter filter = new RibbonRoutingFilter(helper, ribbonCommandFactory,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment