@@ -118,9 +118,8 @@ private WorkflowExecution startWorkflowInternal(StartWorkflowExecutionParameters
118
118
StartWorkflowExecutionResponse result ;
119
119
try {
120
120
result =
121
- Retryer .retryWithResult (
122
- Retryer .DEFAULT_SERVICE_OPERATION_RETRY_OPTIONS ,
123
- () -> service .StartWorkflowExecution (request ));
121
+ RpcRetryer .retryWithResult (
122
+ RpcRetryer .DEFAULT_RPC_RETRY_OPTIONS , () -> service .StartWorkflowExecution (request ));
124
123
} catch (WorkflowExecutionAlreadyStartedError e ) {
125
124
throw e ;
126
125
} catch (TException e ) {
@@ -137,7 +136,7 @@ private RetryOptions getRetryOptionsWithExpiration(RetryOptions o, Long timeoutI
137
136
if (timeoutInMillis == null || timeoutInMillis <= 0 || timeoutInMillis == Long .MAX_VALUE ) {
138
137
return o ;
139
138
}
140
- return new RetryOptions .Builder (Retryer . DEFAULT_SERVICE_OPERATION_RETRY_OPTIONS )
139
+ return new RetryOptions .Builder (RpcRetryer . DEFAULT_RPC_RETRY_OPTIONS )
141
140
.setExpiration (Duration .ofMillis ((timeoutInMillis )))
142
141
.build ();
143
142
}
@@ -146,9 +145,8 @@ private CompletableFuture<WorkflowExecution> startWorkflowAsyncInternal(
146
145
StartWorkflowExecutionParameters startParameters , Long timeoutInMillis ) {
147
146
StartWorkflowExecutionRequest request = getStartRequest (startParameters );
148
147
149
- return Retryer .retryWithResultAsync (
150
- getRetryOptionsWithExpiration (
151
- Retryer .DEFAULT_SERVICE_OPERATION_RETRY_OPTIONS , timeoutInMillis ),
148
+ return RpcRetryer .retryWithResultAsync (
149
+ getRetryOptionsWithExpiration (RpcRetryer .DEFAULT_RPC_RETRY_OPTIONS , timeoutInMillis ),
152
150
() -> {
153
151
CompletableFuture <WorkflowExecution > result = new CompletableFuture <>();
154
152
try {
@@ -272,9 +270,7 @@ public void signalWorkflowExecution(SignalExternalWorkflowParameters signalParam
272
270
SignalWorkflowExecutionRequest request = getSignalRequest (signalParameters );
273
271
274
272
try {
275
- Retryer .retry (
276
- Retryer .DEFAULT_SERVICE_OPERATION_RETRY_OPTIONS ,
277
- () -> service .SignalWorkflowExecution (request ));
273
+ RpcRetryer .retry (() -> service .SignalWorkflowExecution (request ));
278
274
} catch (TException e ) {
279
275
throw CheckedExceptionWrapper .wrap (e );
280
276
}
@@ -290,9 +286,8 @@ public CompletableFuture<Void> signalWorkflowExecutionAsync(
290
286
public CompletableFuture <Void > signalWorkflowExecutionAsync (
291
287
SignalExternalWorkflowParameters signalParameters , Long timeoutInMillis ) {
292
288
SignalWorkflowExecutionRequest request = getSignalRequest (signalParameters );
293
- return Retryer .retryWithResultAsync (
294
- getRetryOptionsWithExpiration (
295
- Retryer .DEFAULT_SERVICE_OPERATION_RETRY_OPTIONS , timeoutInMillis ),
289
+ return RpcRetryer .retryWithResultAsync (
290
+ getRetryOptionsWithExpiration (RpcRetryer .DEFAULT_RPC_RETRY_OPTIONS , timeoutInMillis ),
296
291
() -> {
297
292
CompletableFuture <Void > result = new CompletableFuture <>();
298
293
try {
@@ -387,8 +382,8 @@ private WorkflowExecution signalWithStartWorkflowInternal(
387
382
StartWorkflowExecutionResponse result ;
388
383
try {
389
384
result =
390
- Retryer .retryWithResult (
391
- Retryer . DEFAULT_SERVICE_OPERATION_RETRY_OPTIONS ,
385
+ RpcRetryer .retryWithResult (
386
+ RpcRetryer . DEFAULT_RPC_RETRY_OPTIONS ,
392
387
() -> service .SignalWithStartWorkflowExecution (request ));
393
388
} catch (TException e ) {
394
389
throw CheckedExceptionWrapper .wrap (e );
@@ -405,9 +400,7 @@ public void requestCancelWorkflowExecution(WorkflowExecution execution) {
405
400
request .setDomain (domain );
406
401
request .setWorkflowExecution (execution );
407
402
try {
408
- Retryer .retry (
409
- Retryer .DEFAULT_SERVICE_OPERATION_RETRY_OPTIONS ,
410
- () -> service .RequestCancelWorkflowExecution (request ));
403
+ RpcRetryer .retry (() -> service .RequestCancelWorkflowExecution (request ));
411
404
} catch (TException e ) {
412
405
throw CheckedExceptionWrapper .wrap (e );
413
406
}
@@ -427,9 +420,8 @@ public QueryWorkflowResponse queryWorkflow(QueryWorkflowParameters queryParamete
427
420
request .setQueryRejectCondition (queryParameters .getQueryRejectCondition ());
428
421
try {
429
422
QueryWorkflowResponse response =
430
- Retryer .retryWithResult (
431
- Retryer .DEFAULT_SERVICE_OPERATION_RETRY_OPTIONS ,
432
- () -> service .QueryWorkflow (request ));
423
+ RpcRetryer .retryWithResult (
424
+ RpcRetryer .DEFAULT_RPC_RETRY_OPTIONS , () -> service .QueryWorkflow (request ));
433
425
return response ;
434
426
} catch (TException e ) {
435
427
throw CheckedExceptionWrapper .wrap (e );
@@ -451,9 +443,7 @@ public void terminateWorkflowExecution(TerminateWorkflowExecutionParameters term
451
443
request .setReason (terminateParameters .getReason ());
452
444
// request.setChildPolicy(terminateParameters.getChildPolicy());
453
445
try {
454
- Retryer .retry (
455
- Retryer .DEFAULT_SERVICE_OPERATION_RETRY_OPTIONS ,
456
- () -> service .TerminateWorkflowExecution (request ));
446
+ RpcRetryer .retry (() -> service .TerminateWorkflowExecution (request ));
457
447
} catch (TException e ) {
458
448
throw CheckedExceptionWrapper .wrap (e );
459
449
}
0 commit comments