禁用Zuul的过滤器
生活随笔
收集整理的這篇文章主要介紹了
禁用Zuul的过滤器
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Disable Zuul Filtershttps://cloud.spring.io/spring-cloud-netflix/reference/html/#_disable_zuul_filters禁用Zuul Filter,Spring Cloud里面的Zuul呢,他有一系列的Zuul Filter,其實就是Spring Cloud為Zuul增強了,然后寫了一大堆的Zuul Filterhttps://github.com/spring-cloud/spring-cloud-netflix/tree/master/spring-cloud-netflix-zuul/
src/main/java/org/springframework/cloud/netflix/zuul/filters到這里面去看這個包,如果你想禁用某一個包呢,類名,過濾器的類名,disable等于true,過濾器的包是過濾器的類型,如果你想禁用SendResponseFilter,/*** Post {@link ZuulFilter} that writes responses from proxied requests to the current response.** @author Spencer Gibb* @author Dave Syer* @author Ryan Baxter*/
public class SendResponseFilter extends ZuulFilter {你可以zuul.SendResponseFilter.post.disable=true直接類名,過濾器的類型,它是POST類型,disable等于true,那我們看一下過濾器的類型是不是POST,這樣你就可以禁用這個過濾器了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 list of filters that you can enable. If you want to disable one, set zuul.<SimpleClassName>.<filterType>.disable=true. By convention, the package after filters is the Zuul filter type. For example to disable org.springframework.cloud.netflix.zuul.filters.post.SendResponseFilter, set zuul.SendResponseFilter.post.disable=true.
?
總結
以上是生活随笔為你收集整理的禁用Zuul的过滤器的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 使用Sidecar支持异构平台的微服务
- 下一篇: SpringCloud导学