Spring Cloud 路由謂詞工廠之間

2024-01-04 17:16 更新

Between路由謂詞工廠采用兩個參數(shù)datetime1datetime2,它們是Java ZonedDateTime對象。該謂詞匹配在datetime1之后和datetime2之前發(fā)生的請求。datetime2參數(shù)必須在datetime1之后。

application.yml。 

spring:
  cloud:
    gateway:
      routes:
      - id: between_route
        uri: https://example.org
        predicates:
        - Between=2017-01-20T17:42:47.789-07:00[America/Denver], 2017-01-21T17:42:47.789-07:00[America/Denver]

該路線與2017年1月20日山區(qū)時間(丹佛)之后和2017年1月21日17:42山區(qū)時間(丹佛)之后的所有請求匹配。這對于維護(hù)時段可能很有用。

以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號