Croway opened a new issue, #9604:
URL: https://github.com/apache/camel-quarkus/issues/9604

   ### Describe the feature here
   
   `camel-quarkus-aws2-s3` has a hard dependency on 
`software.amazon.awssdk.crt:aws-crt`. The POM comment says this is because 
otherwise "GraalVM complains about missing classes from aws-crt". The jar 
(0.50.0) is ~23.8 MB of prebuilt native libraries for every OS and 
architecture, and it ships in every S3 application:
   
   - **JVM mode:** it is ~31% of `quarkus-app/lib` for the aws2-s3 integration 
test (77.6 MB). Camel's S3 component never needs it. It only uses the 
synchronous `S3Client`, with CRC32 for stream uploads. Plain Camel and Camel 
Spring Boot don't ship it.
   - **Native mode:** it adds ~1 MB to the binary and enables nothing. Even 
with aws-crt on the classpath, a `CRC64NVME` upload fails with `Could not load 
software.amazon.awssdk.crt.checksums.CRC64NVME. Add dependency on 
'software.amazon.awssdk.crt:aws-crt'`. The SDK loads that class reflectively, 
and nothing registers it.
   
   **Why the native build fails without it.** All 18 AWS deployment processors 
(`aws2-athena` … `aws2-translate`) register *every* `ExecutionInterceptor` in 
the combined index for reflection. That includes the S3 CRT client's 
`DefaultS3CrtAsyncClient$AttachHttpAttributesExecutionInterceptor` and 
`$ValidateRequestInterceptor`. Those use `S3InternalSdkHttpExecutionAttribute`, 
whose static initializer references 
`software.amazon.awssdk.crt.s3.ResumeToken.class`, so without aws-crt the image 
build fails with:
   
   ```
   Error: Class initialization of 
software.amazon.awssdk.services.s3.internal.crt.S3InternalSdkHttpExecutionAttribute
 failed.
   Caused by: java.lang.NoClassDefFoundError: 
software/amazon/awssdk/crt/s3/ResumeToken
   ```
   
   This is the same failure as #9128. It happens for *any* AWS extension once 
the S3 SDK is on the classpath without aws-crt, not only for aws2-s3. Those 
interceptors are installed programmatically by the S3 CRT client, so they never 
need to be registered when aws-crt is absent.
   
   **Proposal**
   
   - Add a small helper in `support-aws2` deployment that lists the 
`ExecutionInterceptor` implementations to register, skipping the AWS SDK's 
`.internal.crt.` classes when aws-crt is not on the classpath. Use it in the 18 
processors instead of the copy-pasted block.
   - Drop the hard `aws-crt` dependency from `camel-quarkus-aws2-s3`. Keep it 
managed in the BOM so applications that want CRT-based checksums (JVM mode) can 
add it without a version.
   - Document the opt-in, and add a 4.0.0 migration-guide entry.
   
   Reading objects is unaffected without aws-crt, including objects that carry 
a `CRC64NVME` checksum, which Amazon S3 computes by default. The SDK then skips 
that algorithm when it validates responses 
(`HttpChecksumUtils.shouldSkipAlgorithm`).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to