在啓動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/** # 斷言,路徑匹配的進行路由