如何在不删除正在运行的连接的情况下,使用API​​管理进行新的API升级 [英] How can I use API management for new API upgrade, without dropping the running connections

查看:101
本文介绍了如何在不删除正在运行的连接的情况下,使用API​​管理进行新的API升级的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Team,

Hello Team,

我在azure scalesets上托管了多个API,以支持高无请求。

I have multiple API hosted on azure scalesets to support high no of requests.

平均约为30000请求来自API。

On average around 30000 request comes to API.

目前,当我们将API升级到新版本时,所有现有请求都会被终止。我们希望使用API​​管理来优雅地升级API,而不会中断正在进行的请求。此外,我们希望通过API管理使用CI / CD来确保快速
和可靠的API部署。

Currently, when we upgrade the API to new version, all the existing requests gets killed. We want to use API management to upgrade the API gracefully without killing the ongoing requests. Additionally we want to use CI/CD via API management to ensure fast and reliable API deployment.

API管理将如何帮助我实现了这个目标吗?

How API management will help me achieve this?

提前谢谢。

推荐答案

更新:API修订似乎实现了您希望实现的目标:https://blogs.msdn.microsoft.com/apimanagement/2017 / 09/14 / versions-revisions /. 

UPDATE: API Revisions appears to achieve what you are hoping to accomplish: https://blogs.msdn.microsoft.com/apimanagement/2017/09/14/versions-revisions/. 

API管理服务支持API版本控制,因此您可以添加第二个API版本,而不会影响仍然针对原始API版本运行的请求,但是您的客户端应用都需要更新以指向新的API版本,并且针对新版本而不是原始版本调用
。 

API Management service supports API versioning so you could add a second API version without impacting the requests still running against the original API version, however your client apps would all need to get updated to point at the new API versions and call against the new version instead of the original version. 

https:// docs .microsoft.com / zh-CN / azure / api-management / api-management-get-started-publish-versions 

https://docs.microsoft.com/en-us/azure/api-management/api-management-get-started-publish-versions 

如果您需要客户端使用SAME URL来调用API,但你想要要更新API而不破坏未完成的请求,那么您可能需要使用Load Balancer进行调查,或者只是使用DNS指向具有新代码的新scaleset部署
。方案是现有客户端将解析为较旧的服务器,您部署新的API代码,更新DNS条目,最终客户端将尝试再次解析您的API主机名,并将新的连接尝试重定向到
您的新服务器和新代码。然后,您可以决定关闭旧服务器的任意时间,或者只是监视请求日志,并等到没有与旧服务器建立新连接,然后将它们拉下线。 

If you need clients to use the SAME URL to call the API but you want to update the API without breaking outstanding requests, then it feels like you may need to also investigate using a Load Balancer, or just use DNS to point at the new scaleset deployment that has your new code. The scenario being that existing clients will resolve to older servers, you deploy new API code, the update DNS entry and eventually clients will attempt to resolve your API hostname again and will redirect new connection attempts against your new servers and new code. Then you could just decide some arbitrary time when you'll shut down the older servers, or just monitor request logs and wait till no new connections are made against the older servers and then pull them offline. 


这篇关于如何在不删除正在运行的连接的情况下,使用API​​管理进行新的API升级的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆