英文:
SSLHandshakeException when running on another thread on AWS Lambda (Java)
问题
我在使用Java在AWS Lambda上的另一个线程进行API调用时遇到以下错误:
javax.net.ssl.SSLHandshakeException: 远程主机在握手期间关闭连接
当我在本地运行时,代码是正常的。但在AWS Lambda上运行时:
- 如果我在主线程上运行,调用是正常的。
- 如果我在没有API调用的情况下在第二个线程上运行,程序也正常。
我怀疑AWS Lambda的第二个线程可能与SSL设置有关的问题。有人遇到过这个问题吗?希望能听到您的分享。
英文:
I experience the following error when I make an api call from another thread on AWS Lambda, using Java.
> javax.net.ssl.SSLHandshakeException:Remote host closed connection
> during Handshake
The code is fine when I run at local.
But when I run on AWS Lambda:
- If I run it on the main thread, the call is fine.
- If I run on the second thread without the api call, the program is fine as well.
I suspect the second thread of AWS Lambda may have some problem with the SSL set up.
Did any experience this? Hope can receive your sharing.
答案1
得分: 1
在AWS Lambda上运行多线程应用不太推荐。
以下是更多详细信息,可以参考:https://dzone.com/articles/multi-threaded-programming-with-aws-lambda
英文:
Having multithreaded application running on a AWS lambda is not so recommended.
Here some more details what to expect
https://dzone.com/articles/multi-threaded-programming-with-aws-lambda
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论