aws-sdk-java-v2 icon indicating copy to clipboard operation
aws-sdk-java-v2 copied to clipboard

DynamoDbEnhanced Java Requests - Allow timeout per operation

Open hrothwell opened this issue 9 months ago • 1 comments

Describe the feature

Using the plain low level DDB java client we are able to use .overrideConfiguration(...) on various requests in order to change behavior per request and not on the entire client level. This does not appear to be possible using the enhanced java client requests.

Example:

// low level request changing timeout for this request
ScanRequest.builder().overrideConfiguration(AwsRequestOverrideConfiguration.builder().apiCallAttemptTimeout(Duration.ZERO).build()).build();

Use Case

When performing a request that I expect might take longer than others I should be able to specify the timeout differently similar to the low level client.

Proposed Solution

Allow .overrideConfiguration(...) on all enhanced requests

Other Information

One proposed solution online is to create a new client with a different timeout, but typically avoid instantiating multiple clients with different configurations as that feels like it goes against best practices of having one client with a shared connection pool.

Acknowledgements

  • [x] I may be able to implement this feature request
  • [ ] This feature might incur a breaking change

AWS Java SDK version used

2.0

JDK version used

JDK 17

Operating System and version

macOS Sequoia 15.4.1

hrothwell avatar May 20 '25 19:05 hrothwell

Related to https://github.com/aws/aws-sdk-java-v2/issues/2514, but for timeouts.

debora-ito avatar May 20 '25 21:05 debora-ito