配置路由器超时

作为 API 代理的一部分访问消息处理器时,您可以配置路由器超时 请求。

尝试访问邮件时,边缘路由器的默认超时时间为 57 秒 在通过 API 代理处理请求时的处理器。超时到期后, 路由器尝试连接到另一个消息处理器(如果有)。否则, 返回一个错误。

以下两个属性用于控制路由器超时:

属性 说明
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 秒。

conf_load_balancing_load.balancing.driver.proxy.read.timeout 一样, 属性,则可以指定除默认值(秒)之外的时间间隔。

要配置路由器的超时,请执行以下操作

  1. 修改 /opt/apigee/customer/application/router.properties 文件。如果文件 不存在,请创建。
  2. 在配置文件中设置属性,如以下示例所示:
    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
  3. 确保属性文件归“apigee”所有用户:
    chown apigee:apigee /opt/apigee/customer/application/router.properties
  4. 重启路由器:
    /opt/apigee/apigee-service/bin/apigee-service edge-router restart

如需设置重试选项,请使用 RetryOption 属性,如 虚拟主机配置属性