简体   繁体   English

收听AWS Lambda

[英]Listen to an AWS Lambda

Is it possible for a Java Lambda client app to "listen" to a result of a lambda? Java Lambda客户端应用程序是否可以“监听” lambda的结果? For example, the client app isn't going to invoke the lambda but say the lambda is triggered from an SNS topic. 例如,客户端应用程序不会调用lambda,而是说lambda是从SNS主题触发的。 I want the client app to be able to get the result of the lambda that was triggered by the SNS. 我希望客户端应用程序能够获取由SNS触发的lambda的结果。 I couldn't find anything in documentations to see if this was possible or not. 我在文档中找不到任何东西来查看这是否可行。

The Lambda client for Java is a part of the AWS SDK for Java. 适用于Java的Lambda客户端是适用于Java的AWS开发工具包的一部分。 It enables you to call the AWS Lambda API from your Java code, and that's it. 它使您能够从Java代码调用AWS Lambda API,仅此而已。 This means that you can run from your Java code roughly the same operations as you normally would from the AWS CLI (create / edit / delete / invoke a function etc.). 这意味着您可以从Java代码运行与从AWS CLI正常执行的操作大致相同的操作(创建/编辑/删除/调用函数等)。

I am not aware of an ability to bind to a Lambda function and listen for a response (in general, regardless of the Java client). 我不知道可以绑定到Lambda函数并侦听响应的能力(通常,无论Java客户端如何)。

What you could probably do is make the Lambda function publish to SNS when it's done running and subscribe to the relevant topic from the Java client, or make SNS notify your client app over HTTP. 什么你很可能要做的是当它这样做的lambda函数发布到SNS运行,并且从Java客户端订阅相关话题,或使SNS通知您的客户端应用程序通过HTTP。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM