如何在AWS步骤函数中求解两个层异步
中有一个用例
AWS步骤函数SFN =步骤函数 ; lambda = lambda函数; be =后端API
sfn => lambda =>是
be == requestId ==> lambda == requestId ==> sfn
继续任务,完成后,恢复SFN流程。
这就是我应该做
- 的状态机使用异步任务。 Step功能服务生成一个任务令牌,用于识别请求的工作并将令牌发送到Lambda集成。
- Lambda功能调用您的后端API,该API开始工作并以ID响应请求。
- Lambda功能完成。 Lambda集成配置为.waitfortaskToken任务类型,然后状态计算机的执行将暂停。
- 后端API完成工作后,它将调用SendTaskSuccess或SendTaskFailure API调用通过它传递令牌。这将最终确定与令牌相关的工作。
- 一旦步骤功能服务接收API调用以最终确定与令牌关联的任务,则状态计算机的执行将恢复。
但是我在这里遇到的问题是我不想触摸后端API,因为那不是我的控制。
问题是我们如何在不修改后端API的情况下实现此异步电话?
There is a use case in AWS Step function
SFN = Step Function; Lambda = Lambda Function; BE = Backend API
SFN => Lambda => BE
BE ==requestId==> Lambda ==requestId==> SFN
BE continues the task , and when it completes, resumes SFN flow.
This is what i am supposed to do
- My State Machine uses an async Task. Step Function service generates a task token to be used to identify the requested work and sends the token to the Lambda integration.
- The Lambda function invokes your backend API, which begins its work and responds with the ID for the request.
- The Lambda function completes. Lambda integration is configured with .waitForTaskToken task type, then the state machine execution will pause.
- When backend API completes the work, it calls a SendTaskSuccess or SendTaskFailure API call passing the token with it. This will finalize the job that was associated with the token.
- Once the Step Function service receives the API call to finalize the task associated with the token, the state machine execution will resume.
But the issue that i have here is I do not want to touch the back end API because that is not my control .
Question is how we can achieve this Async call without modifying Back End API ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论