[英]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: 我要实现以下目标:
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.