简体   繁体   English

将具有指定输入的API回调计划到我的服务器

[英]Schedule API callback with specified input to my server

I've a Nodejs server running on Amazon EC2 cloud under ELB which serves REST APIs to android and web clients. 我有一个在ELB下的Amazon EC2云上运行的Nodejs服务器,该服务器为android和web客户端提供REST API。 I want to achieve following: 我要实现以下目标:

  • Client executes /book API with callback time and booking_id as input. 客户端以回调时间和booking_id作为输入执行/ book API。
  • Node server registers callback to it's /serve API with booking_id as input at callback time specified in /book request 节点服务器在/ book请求中指定的回调时间将其booking_id作为输入注册到其/ serve API的回调

Example: 例:
1. Client A calls /book API with input 1.客户端A通过输入调用/ book API
{ "booking_id": 1234, "callback_at" :"Oct 4, 5 pm" }
(The actual callback_at value will be an ISO timestamp.) (实际的callback_at值将是一个ISO时间戳。)

2. NodeJS server under ELB registers callback to /serve API with some scheduler like AWS Lambda at Oct 4, 5pm and input as booking_id 1234. 2. ELB下的NodeJS服务器在10月4日下午5点通过一些调度程序(例如AWS Lambda)注册对/ serve API的回调,并输入booking_id 1234。

I cannot use OS based or other system specific scheduler which will fail if that instance of server under ELB goes down. 我不能使用基于OS或其他特定于系统的调度程序,如果ELB下的服务器实例发生故障,该调度程序将失败。 It has to be a scale-able solution. 它必须是可扩展的解决方案。
Therefore, it must be some external scheduler service. 因此,它必须是某些外部调度程序服务。
So far I've found AWS Lambda as possible solution to achieve this. 到目前为止,我已经发现AWS Lambda是实现此目标的可能解决方案。 Are there better/free alternatives for scheduling callback? 是否有更好/免费的替代方案来安排回调?
Is there a better approach to fulfil this requirement? 是否有更好的方法来满足此要求?

Thanks in advance! 提前致谢!

看看节点时间表: https//www.npmjs.com/package/node-schedule

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

相关问题 如何将我从第三方 API 获取的数据存储在我的快速服务器中,并在以后安排另一个 API 调用? - How to store the data I've fetched from a third-party API in my express server and schedule another API call at a later time? 无状态REST服务器上的Google API回调 - Google API Callback on Stateless REST server 节点API回调与服务器Websocket通信 - Node API callback communicate with a Server websocket 人偶在指定时间安排动作 - Puppeteer schedule action at specified time 节点计划的回调中的回调 - callback in node-schedule's callback 用于连接到指定 socket.io 服务器的输入变量 - Input variable for connecting to a specified socket.io server 如何动态调度 function 在指定时间运行 - How to dynamically schedule a function to run at specified time 为什么在流 API 的 .write() 方法中需要回调? - Why do I need a callback in my .write() method for the stream API? 角度6-我的所有测试均失败,并显示“超时-jasmine.DEFAULT_TIMEOUT_INTERVAL指定的超时内未调用异步回调” - Angular 6 - All my tests fail with “Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL” 如何使用节点计划在指定的时间运行任务? - how to run task on specified time using node-schedule?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM