是否有某种服务来排队 api 调用? [英] Is there some kind of service to queue api calls?

查看:24
本文介绍了是否有某种服务来排队 api 调用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当客户在我的网站上填写表单时,我需要调用desk.com api 来创建案例.但是,有时 API 会因维护而关闭(太频繁了!),我的调用会失败.

I need to call the desk.com api to create cases when a customer completes a form on my site. However sometimes the API is down for maintenance (too often!) and my call will fail.

目前我只是将详细信息写入登录错误并向自己发送电子邮件.然后我手动创建案例.

Presently I just write the details to a log on error and send myself an email. Then I create the case manually.

所以我正在考虑编写某种消息队列,而不是在进程中调用 api,我可以将请求放入队列中,然后让一些进程处理队列并进行 api 调用.如果 api 调用失败,他们会在下一个预定的时间间隔内重试.

So I'm thinking to write some kind of message queue so instead of calling the api in-process, I can put the request in queue, then have some process work the queue and make the api calls. they way if the api call fails the process will just try again next scheduled interval.

由于世界上有如此多的 Web API,我想其他人肯定也有同样的问题.那么是否有一些第三方解决方案可以有效地完成我想要做的事情?或者一些开源项目或其他东西来处理这个问题?

Since there are so many web APIs in the world, I figure surely other people must be having the same problem. So are there some third-party solutions which effectively do what I'm trying to do? or some open-source project or something to deal with this issue?

干杯!

推荐答案

Amazon Simple Queue Service (SQS) 是一种快速、可靠、可扩展、完全托管的队列服务.SQS 使分离云应用程序的组件变得简单且经济高效.您可以使用 SQS 以任何吞吐量级别传输任何数量的数据,而不会丢失消息或要求其他服务始终可用.

Amazon Simple Queue Service (SQS) is a fast, reliable, scalable, fully managed queue service. SQS makes it simple and cost-effective to decouple the components of a cloud application. You can use SQS to transmit any volume of data, at any level of throughput, without losing messages or requiring other services to be always available.

http://aws.amazon.com/sqs/

这篇关于是否有某种服务来排队 api 调用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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