简体   繁体   English

如果后端无故障,如何配置apigee失效?

[英]How can I configure apigee to fail stale if the backend is unavialble?

We have an API proxy configured with cache ttl of 2mins. 我们有一个配置了2分钟缓存ttl的API代理。 Is it possible to configure apigee to serve stale cached content if the backend goes down so that our end users don't see errors? 如果后端发生故障,是否可以将apigee配置为提供过时的缓存内容,以便最终用户看不到错误?

We would rather have our end users get copies of stale cached content (even after the configured ttl of 2mins expires) instead of errors when the backend goes down. 我们宁愿让最终用户获得陈旧的缓存内容的副本(即使在配置的2分钟的ttl过期后),而不是在后端出现故障时获得错误。

Would appreciate if someone could point me to the relevant documentation if this is possible. 如果可以的话,如果有人可以将我指向相关文档,将不胜感激。

Options i can think of is to 我能想到的选择是

  1. handle the specific error code using Target Endpoint properties to not consider the error code as error and have a flow serve the cached data. 使用目标端点属性处理特定的错误代码,而不将错误代码视为错误,并有流程为缓存的数据提供服务。

  2. use fault flows to deal with error and have the fault flow serve the required data. 使用故障流来处理错误并让故障流提供所需的数据。

Once the cache TTL expires the cached data is no longer accessible, even as "stale" data. 一旦缓存TTL过期,就不再可以访问缓存的数据,即使是“陈旧”的数据也是如此。 You can consider using something like Apigee BaaS to store data as a "cache" with an appropriate TTL so that if the back-end is up you can serve the last-retrieved data from BaaS, or you can extend your cache TTL so that the data remains available even if the back end is down. 您可以考虑使用Apigee BaaS之类的东西将数据存储为具有适当TTL的“缓存”,这样,如果后端已启动,则可以提供来自BaaS的最后检索的数据,或者可以扩展缓存TTL,以便即使后端关闭,数据仍然可用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM