【问题标题】:S3Client and Quarkus Native App Issueu with RunnS3Client 和 Quarkus Native App Issueu with Runn
【发布时间】:2020-05-04 20:40:19
【问题描述】:

我正在尝试创建一个 lambda S3 侦听器,将 Lambda 用作本机映像。关键是获取 S3 事件,然后通过拉取文件等来做一些工作。为了获取文件,我使用如下所示的 het AWS 2.x S3 客户端

S3Client.builder().httpClient().build();

这段代码导致

2020-03-12 19:45:06,205 ERROR [io.qua.ama.lam.run.AmazonLambdaRecorder] (Lambda Thread) Failed to run lambda: software.amazon.awssdk.core.exception.SdkClientException: Unable to load an HTTP implementation from any provider in the chain. You must declare a dependency on an appropriate HTTP implementation or pass in an SdkHttpClient explicitly to the client builder.

为了解决这个问题,我添加了 aws apache 客户端并更新了代码以执行以下操作:

  1. SdkHttpClient httpClient = ApacheHttpClient.builder(). maxConnections(50). build()
  2. S3Client.builder().httpClient(httpClient).build();
  3. 我还必须添加: [ ["org.apache.http.conn.HttpClientConnectionManager", "org.apache.http.pool.ConnPoolControl","software.amazon.awssdk.http.apache.internal.conn.Wrapped"] ]

在此之后,我现在得到以下堆栈跟踪:

Caused by: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
at java.security.cert.PKIXParameters.setTrustAnchors(PKIXParameters.java:200)
at java.security.cert.PKIXParameters.<init>(PKIXParameters.java:120)
at java.security.cert.PKIXBuilderParameters.<init>(PKIXBuilderParameters.java:104)
at sun.security.validator.PKIXValidator.<init>(PKIXValidator.java:86)
... 76 more

我在 graal 的 19.3.1 上运行 qurkaus 1.2.0 版。我正在通过 Maven 和为 Quarkus 提供的 docker 容器构建它。我认为默认情况下添加了信任库(在构建命令中它看起来是准确的)但是我错过了什么吗?是否有另一种方法可以在不设置 S3 客户端上的 HttpService 的情况下运行它?

【问题讨论】:

    标签: amazon-web-services amazon-s3 quarkus


    【解决方案1】:

    有一个PR,目前正在审查中,它引入了 JVM 和 Native 的 AWS S3 扩展。 AWS 客户端是完全 Quarkified,这意味着通过 application.properties 配置并启用依赖注入。请继续关注,因为它很可能在 Quarkus 1.5.0 中可用

    【讨论】:

      猜你喜欢
      • 2022-08-18
      • 2020-01-07
      • 2020-09-03
      • 2021-12-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-05
      相关资源
      最近更新 更多