找不到Gateway Filter 中的Unable to find GatewayFilterFactory with name AddRequestHeadersIfNotPresent

在学习Gateway Filter中 配置FilterAddRequestHeadersIfNotPresent时运行报错Unable to find GatewayFilterFactory with name AddRequestHeadersIfNotPresent,我查看了一遍配置文件并没有写错名字或缩进错误

找了半天也没有发现任何错误,然后我在@Configuration注解下的配置文件中尝试使用api形式去写,但是根本找不到.addRequestHeadersIfNotPresen,可以找到.addRequestHeader方法。

有可能是添加依赖的问题,但是和其他的断言api相互矛盾,如果是依赖的问题,其他的api也应该不能使用,所以这个问题到现在还没有解决,有没有大神可以解决一下,看看是哪里的问题!!

猜你喜欢

转载自blog.csdn.net/weixin_67634317/article/details/132826760