Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-13563

Generalize AWS client provider to be independent of client type

Details

    • Improvement
    • Status: Triage Needed
    • P3
    • Resolution: Fixed
    • None
    • 2.38.0
    • io-java-aws

    Description

      Currently each AWS IO uses its own client provider, in some cases also separate ones for sync and async clients.

      Besides adding lots of boilerplate code across these IOs, this makes it impossible to switch to an async implementation without breaking APIs. 

      The approach below would require only one common client provider to build all kinds of clients:

      public <BuilderT extends AwsClientBuilder<BuilderT, ClientT>, ClientT> ClientT buildClient(BuilderT builder) {
        if (endpoint != null) {
          builder.endpointOverride(URI.create(endpoint));
        }
        return builder
            .credentialsProvider(credentialsProvider)
            .region(Region.of(region))
            .build();
      }
      
      buildClient(DynamoDbClient.builder());
      buildClient(DynamoDbAsyncClient.builder());
      buildClient(S3Client.builder());
      buildClient(S3AsyncClient.builder());
      ...

      Attachments

        Issue Links

          Activity

            People

              mosche Moritz Mack
              mosche Moritz Mack
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 10h 10m
                  10h 10m