forked from temporalio/sdk-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add backoff to WorkflowExecutionUtils#getInstanceCloseEvent (temporal…
…io#667) Update some options of DefaultStubServiceOperationRpcRetryOptions to be close to Go SDK behavior Issue temporalio#651
- Loading branch information
1 parent
c167ff9
commit 6d55180
Showing
7 changed files
with
124 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
.../src/main/java/io/temporal/serviceclient/rpcretry/DefaultStubLongPollRpcRetryOptions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright (C) 2020 Temporal Technologies, Inc. All Rights Reserved. | ||
* | ||
* Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Modifications copyright (C) 2017 Uber Technologies, Inc. | ||
* | ||
* 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 io.temporal.serviceclient.rpcretry; | ||
|
||
import io.temporal.serviceclient.RpcRetryOptions; | ||
import java.time.Duration; | ||
|
||
/** Default rpc retry options for long polls like waiting for the workflow finishing and result. */ | ||
public class DefaultStubLongPollRpcRetryOptions { | ||
public static final Duration INITIAL_INTERVAL = Duration.ofMillis(1); | ||
public static final Duration MAXIMUM_INTERVAL = Duration.ofMinutes(1); | ||
public static final double BACKOFF = 1.2; | ||
|
||
public static RpcRetryOptions.Builder getBuilder() { | ||
RpcRetryOptions.Builder roBuilder = | ||
RpcRetryOptions.newBuilder() | ||
.setInitialInterval(INITIAL_INTERVAL) | ||
.setBackoffCoefficient(BACKOFF) | ||
.setMaximumInterval(MAXIMUM_INTERVAL); | ||
|
||
DefaultStubServiceOperationRpcRetryOptions.TEMPORAL_SERVER_DEFAULT_NON_RETRY.forEach( | ||
roBuilder::addDoNotRetry); | ||
|
||
return roBuilder; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters