在启动Spring Cloud Gateway是报错:
org.springframework.context.ApplicationContextException: Failed to start bean 'eurekaAutoServiceRegistration'; nested exception is reactor.core.Exceptions$ErrorCallbackNotImplemented: java.lang.IllegalArgumentException: Unable to find RoutePredicateFactory with name path
原因是我的配置文件application.yml中配置routes时, Path字母P小写导致的,应该是大写
routes:
- id: payment_fast #路由id,要求唯一
uri: http://localhost:8001 # 匹配后提供服务的路由地址
predicates:
- Path=/payment/get/** # 断言,路径匹配的进行路由
- id: payment_slow #路由id,要求唯一
uri: http://localhost:8001 # 匹配后提供服务的路由地址
predicates:
- Path=/payment/out/** # 断言,路径匹配的进行路由