ppalaga commented on issue #2925:
URL: https://github.com/apache/camel-quarkus/issues/2925#issuecomment-884813394


   @tstuber if you are able to construct an instance of S3Client manually (with 
proxy set on its http client and with a proper STS credentials provider with 
properly set proxy again), then you can pass the S3 client instance to Camel 
via CDI like this:
   
   ```
   import java.net.URI;
   import javax.inject.Named;
   import javax.inject.Singleton;
   
   import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
   import software.amazon.awssdk.http.apache.ApacheHttpClient;
   import software.amazon.awssdk.http.apache.ProxyConfiguration;
   import software.amazon.awssdk.services.s3.S3Client;
   
   @Singleton
   public class Producers extends EndpointRouteBuilder{
   
       @Named("myS3Client")
       S3Client s3Client() {
           ProxyConfiguration.Builder proxyConfig = 
ProxyConfiguration.builder().endpoint(URI.create("http://localhost:1234";));
           ApacheHttpClient.Builder httpClientBuilder = 
ApacheHttpClient.builder().proxyConfiguration(proxyConfig.build());
   
           AwsCredentialsProvider credsProvider = null; // your STS based creds 
provider with proxy set
           return S3Client.builder()
                   .httpClientBuilder(httpClientBuilder)
                   .credentialsProvider(credsProvider)
                   .build();
       }
   }
   ```
   
   ```
   class Routes extends EndpointRouteBuilder {
       @Override
       public void configure() throws Exception {
           from(aws2S3("{{bucketName}}")
           .amazonS3Client("#myS3Client"))
           .log("body received: ${body}");
       }
   }
   ```


-- 
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: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to