透過 API Proxy 要求存取訊息處理器時,您可以設定路由器逾時。
在嘗試透過 API Proxy 處理訊息處理要求時,邊緣路由器的預設逾時時間為 57 秒。逾時之後,路由器會嘗試連線至其他「訊息處理器」,如果有的話。否則,系統會傳回錯誤。
下列兩個屬性會控制路由器逾時:
屬性 | 說明 |
---|---|
conf_load_balancing_load.balancing.driver.proxy.read.timeout |
|
指定單一路由器的等待時間,預設值為 57 秒。 您可以使用下列標記法將時間間隔設為秒以外的時間: ms: milliseconds s: seconds (default) m: minutes h: hours d: days w: weeks M: months (length of 30 days) y: years (length of 365 days) 例如,如要將等待時間設為 2 小時,您可以使用下列其中一個值: conf_load_balancing_load.balancing.driver.proxy.read.timeout=2h # 2 hours OR conf_load_balancing_load.balancing.driver.proxy.read.timeout=120m # 120 minutes |
|
conf_load_balancing_load.balancing.driver.nginx.upstream_next_timeout |
|
指定 Edge 安裝作業具備多個訊息處理工具時的等待總時間。預設值為目前的 conf_load_balancing_load.balancing.driver.proxy.read.timeout 值或 57 秒。與 |
如何設定路由器的逾時:
- 編輯
/opt/apigee/customer/application/router.properties
檔案。如果檔案不存在,請建立檔案。 - 請設定設定檔中的屬性,如以下範例所示:
conf_load_balancing_load.balancing.driver.proxy.read.timeout=1800000ms # 1800000 milliseconds conf_load_balancing_load.balancing.driver.nginx.upstream_next_timeout=1d # 1 day
- 確認屬性檔案為「Apigee」使用者:
chown apigee:apigee /opt/apigee/customer/application/router.properties
- 重新啟動路由器:
/opt/apigee/apigee-service/bin/apigee-service edge-router restart
如要設定重試選項,請使用虛擬主機設定屬性中所述的 RetryOption
屬性。