spring cloud gateway啟動報錯Property: spring.cloud.gateway.routes[2].predicates的原因及解決


報錯內容如下:

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是必須寫的。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM