报错内容如下:
Binding to target org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'spring.cloud.gateway' to org.springframework.cloud.gateway.config.GatewayProperties failed: Property: spring.cloud.gateway.routes[2].predicates Value: [] Reason: 不能为空
原因及解决:
geteway的某一个路由里没有写predicates断言,routes[2]就表示第三个路由,在指定的位置加上断言就好了。
gateway的filter并不是必须写的,但predicates是必须写的。