Skip to content

Merge retries #5283

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 52 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
7ef8830
New API for the retries module (#3769)
sugmanue Mar 8, 2023
f40dd27
Add default backoff strategies (#3906)
sugmanue Apr 19, 2023
a806cd7
Add standard retry strategy (#3931)
sugmanue Apr 27, 2023
dd63b90
Add adaptive retry strategy (#3975)
sugmanue May 9, 2023
1a2da50
Merge remote-tracking branch 'upstream/master' into feature/master/sr…
sugmanue May 9, 2023
c6fb01d
Merge remote-tracking branch 'upstream/master' into feature/master/sr…
sugmanue May 9, 2023
1e4dfc4
Update retries and retries-api to snapshot version: 2.20.64-SNAPSHOT
sugmanue May 9, 2023
840a2bf
Fix SonarCloud code smells (#3991)
sugmanue May 10, 2023
3b1b732
Add legacy retry strategy (#3988)
sugmanue May 24, 2023
78bd7a1
Merge remote-tracking branch 'upstream/master' into feature/master/sr…
sugmanue May 24, 2023
ac50063
Remove those tests that are now part of a different class
sugmanue May 24, 2023
46e5194
Update version after merge from master
sugmanue May 24, 2023
4fbcdb6
Refactor retry strategies (#4039)
sugmanue May 27, 2023
7511e0d
Merge remote-tracking branch 'upstream/master' into feature/master/sr…
sugmanue Jun 2, 2023
c434b26
Update sdk version
sugmanue Jun 2, 2023
03817c3
Fix the retry condition to just look for the initial cause
sugmanue Jun 2, 2023
811c9b1
Add new sync and async retryable stages (#4062)
sugmanue Jun 7, 2023
79a592c
Merge remote-tracking branch 'upstream/master' into feature/master/sr…
sugmanue Jun 16, 2023
5b116d2
Update sdk version
sugmanue Jun 16, 2023
43fcfef
Change uses of RetryPolicy to RetryStrategy (#4125)
sugmanue Jun 23, 2023
0a3bbfa
Merge remote-tracking branch 'upstream/master' into feature/master/sr…
sugmanue Jun 28, 2023
64648eb
Update sdk version
sugmanue Jun 28, 2023
75842c1
Deprecate legacy classes and use new when possible (#4154)
sugmanue Jun 30, 2023
7b76246
Merge remote-tracking branch 'upstream/master' into feature/master/sr…
sugmanue Jul 7, 2023
4acd4e3
Fix minor logging issues
sugmanue Jul 7, 2023
0d0d819
Update sdk version
sugmanue Jul 7, 2023
802ae19
Add support for retryable trait (#4170)
sugmanue Jul 18, 2023
13c32f6
Merge remote-tracking branch 'upstream/master' into feature/master/sr…
sugmanue Aug 14, 2023
5aec47f
Merge master
sugmanue Sep 7, 2023
696fd16
Merge remote-tracking branch 'upstream/master' into sugmanue/sra-retr…
sugmanue Oct 9, 2023
a5202ce
Merge remote-tracking branch 'upstream/master' into feature/master/sr…
sugmanue Dec 14, 2023
53fc254
Merge remote-tracking branch 'upstream/master' into sugmanue/sra-retr…
sugmanue Apr 2, 2024
17a6c57
Update to support plugins
sugmanue Apr 5, 2024
0a75aac
Add support for AWS retryable conditions
sugmanue Apr 5, 2024
c1f76d8
Merge remote-tracking branch 'upstream/master' into sugmanue/sra-retr…
sugmanue Apr 17, 2024
c21eeed
Use the correct token bucket exception cost value
sugmanue Apr 22, 2024
67b7844
Add ADAPTIVE_V2 retry mode to support the legacy behavior (#5123)
sugmanue May 1, 2024
927a900
Remove a small typo
sugmanue May 1, 2024
490b5bd
Merge remote-tracking branch 'upstream/master' into sugmanue/sra-retr…
sugmanue May 1, 2024
42a8173
Merge remote-tracking branch 'upstream/master' into sugmanue/sra-retr…
sugmanue May 8, 2024
423c351
Dumy commit
joviegas May 10, 2024
a20250b
Dummy commit to kick the internal build
sugmanue May 10, 2024
2245f8c
Rename retries-api to retries-spi
sugmanue May 10, 2024
4f55d57
Add retry packages to brazil (#5215)
sugmanue May 10, 2024
ccce8b8
Merge remote-tracking branch 'upstream/master' into sugmanue/sra-retr…
sugmanue May 15, 2024
c8ac21e
Remove type params from RetryStrategy, but keep them in RetryStrategy…
sugmanue Jun 4, 2024
3b5cdbd
External names used for retry modes only support 'adaptive' (#5265)
sugmanue Jun 5, 2024
ac0717c
Merge remote-tracking branch 'upstream/master' into feature/master/sr…
sugmanue Jun 5, 2024
5d34646
Merge remote-tracking branch 'upstream/master' into sugmanue/sra-retr…
sugmanue Jun 10, 2024
d875f06
Retries release (#5280)
sugmanue Jun 10, 2024
2fd7c5a
Merge remote-tracking branch 'upstream/master' into sugmanue/sra-retr…
sugmanue Jun 10, 2024
15c6c94
Archive the last changelog from the 2.25 series
sugmanue Jun 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .brazil.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
"http-auth-aws": { "packageName": "AwsJavaSdk-Core-HttpAuthAws" },
"http-auth-aws-crt": { "packageName": "AwsJavaSdk-Core-HttpAuthAwsCrt" },
"http-auth-aws-eventstream": { "packageName": "AwsJavaSdk-Core-HttpAuthAwsEventStream" },
"retries-spi": { "packageName": "AwsJavaSdk-Core-RetriesSpi" },
"retries": { "packageName": "AwsJavaSdk-Core-Retries" },

"dynamodb": { "packageName": "AwsJavaSdk-DynamoDb" },
"waf": { "packageName": "AwsJavaSdk-Waf" },
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions .changes/next-release/bugfix-AWSSDKforJavav2-85d899c.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"type": "bugfix",
"category": "AWS SDK for Java v2",
"contributor": "",
"description": "Fixed an issue in async client where the future would get stuck if there is a server error and the server fails to return response body that matches with the content length specified in the response header. See [#4354](https://github.com/aws/aws-sdk-java-v2/issues/4354)"
}
6 changes: 6 additions & 0 deletions .changes/next-release/feature-AWSSDKforJavav2-05480c7.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"category": "\"AWS SDK for Java v2\"",
"contributor": "sugmanue",
"type": "feature",
"description": "This release contains a major internal refactor of retries and is part\nof moving the SDK to a standardized AWS SDK architecture. It\nintroduces the interface `RetryStrategy` and three subclasses\n`StandardRetryStrategy`, `LegacyRetryStrategy` , and\n`AdaptiveRetryStrategy`. The new interfaces live in the `retry-spi`\nmodule, and the implementation classes live in the `retries` module.\n\nNote 1) This change marks RetryPolicy as as deprecated and we\nencourage users to migrate to its replacement, RetryStrategy. However,\nretry policies are, and will for the foreseeable future be fully\nsupported. Clients configured to use retry policies will not need any\ncode changes and won\u2019t see any behavioral change with this release.\n\nNote 2) The original implementation of adaptive mode (see\n[#2658](https://github.com/aws/aws-sdk-java-v2/pull/2658)) that was\nreleased with the retry policy API contains a bug in its rate-limiter\nlogic which prevents it from remembering state across requests. In\nthis release of the retry strategy API, we introduce\n`RetryMode.ADAPTIVE_V2`, which implements the correct adaptive\nbehavior. `RetryMode.ADAPTIVE` is still present in order to maintain\nbackwards compatibility, but is now marked as deprecated.\n\nNote 3) When configuring retry mode through system settings or\nenvironment variables, users can only choose adaptive mode. This\nsetting will map to `RetryMode.ADAPTIVE_V2` instead of\n`RetryMode.ADAPTIVE` with this release, giving users the correct\nbehavior and still keeping the settings consistent across all\nSDKs. The list of configuration options are: profile file `retry_mode`\nsetting, the `aws.retryMode` system property and the `AWS_RETRY_MODE`\nenvironment variable."
}
6 changes: 6 additions & 0 deletions .changes/next-release/feature-AWSSDKforJavav2-b456b1c.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"category": "AWS SDK for Java v2",
"contributor": "sugmanue",
"type": "feature",
"description": "Adds the new module retries API module"
}
2 changes: 1 addition & 1 deletion archetypes/archetype-app-quickstart/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>archetypes</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.25.71-SNAPSHOT</version>
<version>2.26.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion archetypes/archetype-lambda/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>archetypes</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.25.71-SNAPSHOT</version>
<version>2.26.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>archetype-lambda</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion archetypes/archetype-tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>archetypes</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.25.71-SNAPSHOT</version>
<version>2.26.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion archetypes/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>aws-sdk-java-pom</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.25.71-SNAPSHOT</version>
<version>2.26.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>archetypes</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion aws-sdk-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.25.71-SNAPSHOT</version>
<version>2.26.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>aws-sdk-java</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bom-internal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>aws-sdk-java-pom</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.25.71-SNAPSHOT</version>
<version>2.26.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
12 changes: 11 additions & 1 deletion bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.25.71-SNAPSHOT</version>
<version>2.26.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>bom</artifactId>
Expand Down Expand Up @@ -172,6 +172,16 @@
<artifactId>http-client-spi</artifactId>
<version>${awsjavasdk.version}</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>retries</artifactId>
<version>${awsjavasdk.version}</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>retries-spi</artifactId>
<version>${awsjavasdk.version}</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>apache-client</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,15 @@ public void visit(Method method) {
}
} else if (isBuildable && method.getName().equals("toBuilder") && method.getSignature().startsWith("()")) {
// This is a buildable toBuilder
constructorsInvokedFromToBuilder.computeIfAbsent(getDottedClassName(), n -> new HashMap<>());
toBuilderModifiedFields.computeIfAbsent(getDottedClassName(), n -> new HashMap<>());
String dottedClassName = getDottedClassName();
constructorsInvokedFromToBuilder.computeIfAbsent(dottedClassName, n -> new HashMap<>());
toBuilderModifiedFields.computeIfAbsent(dottedClassName, n -> new HashMap<>());
inBuildableToBuilder = true;
inBuilderConstructor = false;

if (method.isAbstract()) {
// Ignore abstract toBuilder methods, we will still validate the actual implementations.
ignoredBuildables.add(dottedClassName);
}
registerIgnoredFields();
} else {
inBuildableToBuilder = false;
Expand Down
2 changes: 1 addition & 1 deletion bundle-logging-bridge/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.25.71-SNAPSHOT</version>
<version>2.26.0-SNAPSHOT</version>
</parent>
<artifactId>bundle-logging-bridge</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion bundle-sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.25.71-SNAPSHOT</version>
<version>2.26.0-SNAPSHOT</version>
</parent>
<artifactId>bundle-sdk</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.25.71-SNAPSHOT</version>
<version>2.26.0-SNAPSHOT</version>
</parent>
<artifactId>bundle</artifactId>
<packaging>jar</packaging>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion codegen-lite-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.25.71-SNAPSHOT</version>
<version>2.26.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>codegen-lite-maven-plugin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion codegen-lite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.25.71-SNAPSHOT</version>
<version>2.26.0-SNAPSHOT</version>
</parent>
<artifactId>codegen-lite</artifactId>
<name>AWS Java SDK :: Code Generator Lite</name>
Expand Down
2 changes: 1 addition & 1 deletion codegen-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.25.71-SNAPSHOT</version>
<version>2.26.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>codegen-maven-plugin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion codegen/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.25.71-SNAPSHOT</version>
<version>2.26.0-SNAPSHOT</version>
</parent>
<artifactId>codegen</artifactId>
<name>AWS Java SDK :: Code Generator</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ private Map<String, ShapeModel> constructExceptionShapes() {
// Java shape models, to be constructed
Map<String, ShapeModel> javaShapes = new HashMap<>();

for (Map.Entry<String, Shape> shape : getServiceModel().getShapes().entrySet()) {
if (shape.getValue().isException()) {
String errorShapeName = shape.getKey();
for (Map.Entry<String, Shape> kvp : getServiceModel().getShapes().entrySet()) {
if (kvp.getValue().isException()) {
Shape shape = kvp.getValue();
String errorShapeName = kvp.getKey();
String javaClassName = getNamingStrategy().getExceptionName(errorShapeName);

ShapeModel exceptionShapeModel = generateShapeModel(javaClassName,
Expand All @@ -55,8 +56,10 @@ private Map<String, ShapeModel> constructExceptionShapes() {
exceptionShapeModel.setType(ShapeType.Exception.getValue());
exceptionShapeModel.setErrorCode(getErrorCode(errorShapeName));
exceptionShapeModel.setHttpStatusCode(getHttpStatusCode(errorShapeName));
exceptionShapeModel.withIsRetryable(shape.isRetryable());
exceptionShapeModel.withIsThrottling(shape.isThrottling());
if (exceptionShapeModel.getDocumentation() == null) {
exceptionShapeModel.setDocumentation(shape.getValue().getDocumentation());
exceptionShapeModel.setDocumentation(shape.getDocumentation());
}

javaShapes.put(javaClassName, exceptionShapeModel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ protected final ShapeModel generateShapeModel(String javaClassName, String shape
shapeModel.withXmlNamespace(shape.getXmlNamespace());
shapeModel.withIsUnion(shape.isUnion());
shapeModel.withIsFault(shape.isFault());
shapeModel.withIsRetryable(shape.isRetryable());
shapeModel.withIsThrottling(shape.isThrottling());

boolean hasHeaderMember = false;
boolean hasStatusCodeMember = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ public class CustomizationConfig {
*/
private String customRetryPolicy;

/**
* Custom Retry strategy
*/
private String customRetryStrategy;

private boolean skipSyncClientGeneration;

/**
Expand Down Expand Up @@ -533,10 +538,18 @@ public String getCustomRetryPolicy() {
return customRetryPolicy;
}

public String getCustomRetryStrategy() {
return customRetryStrategy;
}

public void setCustomRetryPolicy(String customRetryPolicy) {
this.customRetryPolicy = customRetryPolicy;
}

public void setCustomRetryStrategy(String customRetryStrategy) {
this.customRetryStrategy = customRetryStrategy;
}

public boolean isSkipSyncClientGeneration() {
return skipSyncClientGeneration;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ public String getCustomRetryPolicy() {
return customizationConfig.getCustomRetryPolicy();
}

public String getCustomRetryStrategy() {
return customizationConfig.getCustomRetryStrategy();
}

public String getSdkModeledExceptionBaseFqcn() {
return String.format("%s.%s",
metadata.getFullModelPackageName(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ public class ShapeModel extends DocumentationModel implements HasDeprecation {

private boolean union;

private boolean retryable;
private boolean throttling;

public ShapeModel() {
}

Expand Down Expand Up @@ -648,4 +651,22 @@ public ShapeModel withIsFault(boolean fault) {
this.fault = fault;
return this;
}

public boolean isRetryable() {
return retryable;
}

public ShapeModel withIsRetryable(boolean retryable) {
this.retryable = retryable;
return this;
}

public boolean isThrottling() {
return throttling;
}

public ShapeModel withIsThrottling(boolean throttling) {
this.throttling = throttling;
return this;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

package software.amazon.awssdk.codegen.model.service;

public class RetryableTrait {

private Boolean throttling;

public void setThrottling(boolean throttling) {
this.throttling = throttling;
}

public Boolean getThrottling() {
return throttling;
}

public boolean isThrottling() {
return Boolean.TRUE.equals(throttling);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ public class Shape {

private boolean union;

private RetryableTrait retryable;

public boolean isFault() {
return fault;
}
Expand Down Expand Up @@ -345,4 +347,16 @@ public boolean isUnion() {
public void setUnion(boolean union) {
this.union = union;
}

public void setRetryable(RetryableTrait retryable) {
this.retryable = retryable;
}

public boolean isRetryable() {
return retryable != null;
}

public boolean isThrottling() {
return retryable != null && retryable.isThrottling();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,12 @@ private MethodSpec finalizeServiceConfigurationMethod() {
PoetUtils.classNameFromFqcn(model.getCustomizationConfig().getCustomRetryPolicy()));
}

if (StringUtils.isNotBlank(model.getCustomizationConfig().getCustomRetryStrategy())) {
builder.addCode(".option($1T.RETRY_STRATEGY, $2T.resolveRetryStrategy(config))",
SdkClientOption.class,
PoetUtils.classNameFromFqcn(model.getCustomizationConfig().getCustomRetryStrategy()));
}

if (StringUtils.isNotBlank(clientConfigClassName)) {
builder.addCode(".option($T.SERVICE_CONFIGURATION, finalServiceConfig)", SdkClientOption.class);
}
Expand Down
Loading
Loading