How do you create custom zuul filters in spring cloud
问题 I want to write some of my own custom zuul filters for a spring cloud microservice i am writing. Once i have the filter written how do I integrate it so the underlying netflix zuul framework can take advantage of it. 回答1: Create a @Bean that extends ZuulFilter . See java configuration examples here. As long as the bean is in the same context as the @EnableZuulProxy app, it will automatically get picked up. @Bean public MyFilter myFilter() { return new MyFilter(); } See examples of filters