@@ -128,7 +128,10 @@ public class WorkflowServiceTChannel implements IWorkflowService {
128
128
private static final long DEFAULT_POLL_RPC_TIMEOUT_MILLIS = 121 * 1000 ;
129
129
130
130
/** Default RPC timeout for QueryWorkflow */
131
- private static final long DEFAULT_QUERY_RPC_TIMEOUT_MILLIS = 10000 ;
131
+ private static final long DEFAULT_QUERY_RPC_TIMEOUT_MILLIS = 10 * 1000 ;
132
+
133
+ /** Default RPC timeout for ListArchivedWorkflow */
134
+ private static final long DEFAULT_LIST_ARCHIVED_WORKFLOW_TIMEOUT_MILLIS = 180 * 1000 ;
132
135
133
136
private static final String DEFAULT_CLIENT_APP_NAME = "cadence-client" ;
134
137
@@ -148,6 +151,9 @@ public static class ClientOptions {
148
151
/** The tChannel timeout for query workflow call in milliseconds */
149
152
private final long rpcQueryTimeoutMillis ;
150
153
154
+ /** The tChannel timeout for list archived workflow call in milliseconds */
155
+ private final long rpcListArchivedWorkflowTimeoutMillis ;
156
+
151
157
/** TChannel service name that the Cadence service was started with. */
152
158
private final String serviceName ;
153
159
@@ -177,6 +183,7 @@ private ClientOptions(Builder builder) {
177
183
}
178
184
this .rpcLongPollTimeoutMillis = builder .rpcLongPollTimeoutMillis ;
179
185
this .rpcQueryTimeoutMillis = builder .rpcQueryTimeoutMillis ;
186
+ this .rpcListArchivedWorkflowTimeoutMillis = builder .rpcListArchivedWorkflowTimeoutMillis ;
180
187
if (builder .metricsScope == null ) {
181
188
builder .metricsScope = NoopScope .getInstance ();
182
189
}
@@ -209,6 +216,11 @@ public long getRpcQueryTimeoutMillis() {
209
216
return rpcQueryTimeoutMillis ;
210
217
}
211
218
219
+ /** @return Returns the rpc timout for list archived workflow requests in millis. */
220
+ public long getRpcListArchivedWorkflowTimeoutMillis () {
221
+ return rpcListArchivedWorkflowTimeoutMillis ;
222
+ }
223
+
212
224
/** Returns the client application name. */
213
225
public String getClientAppName () {
214
226
return this .clientAppName ;
@@ -242,6 +254,8 @@ public static class Builder {
242
254
private long rpcTimeoutMillis = DEFAULT_RPC_TIMEOUT_MILLIS ;
243
255
private long rpcLongPollTimeoutMillis = DEFAULT_POLL_RPC_TIMEOUT_MILLIS ;
244
256
public long rpcQueryTimeoutMillis = DEFAULT_QUERY_RPC_TIMEOUT_MILLIS ;
257
+ public long rpcListArchivedWorkflowTimeoutMillis =
258
+ DEFAULT_LIST_ARCHIVED_WORKFLOW_TIMEOUT_MILLIS ;
245
259
public String serviceName ;
246
260
private Scope metricsScope ;
247
261
private Map <String , String > transportHeaders ;
@@ -279,6 +293,16 @@ public Builder setQueryRpcTimeout(long timeoutMillis) {
279
293
return this ;
280
294
}
281
295
296
+ /**
297
+ * Sets the rpc timeout value for query calls. Default is 180000.
298
+ *
299
+ * @param timeoutMillis timeout, in millis.
300
+ */
301
+ public Builder setListArchivedWorkflowRpcTimeout (long timeoutMillis ) {
302
+ this .rpcListArchivedWorkflowTimeoutMillis = timeoutMillis ;
303
+ return this ;
304
+ }
305
+
282
306
/**
283
307
* Sets the client application name.
284
308
*
@@ -1717,7 +1741,8 @@ private ListArchivedWorkflowExecutionsResponse listArchivedWorkflowExecutions(
1717
1741
ThriftRequest <WorkflowService .ListArchivedWorkflowExecutions_args > request =
1718
1742
buildThriftRequest (
1719
1743
"ListArchivedWorkflowExecutions" ,
1720
- new WorkflowService .ListArchivedWorkflowExecutions_args (listRequest ));
1744
+ new WorkflowService .ListArchivedWorkflowExecutions_args (listRequest ),
1745
+ options .getRpcListArchivedWorkflowTimeoutMillis ());
1721
1746
response = doRemoteCall (request );
1722
1747
WorkflowService .ListArchivedWorkflowExecutions_result result =
1723
1748
response .getBody (WorkflowService .ListArchivedWorkflowExecutions_result .class );
@@ -2340,7 +2365,9 @@ public void ListWorkflowExecutions(
2340
2365
@ Override
2341
2366
public void ListArchivedWorkflowExecutions (
2342
2367
ListArchivedWorkflowExecutionsRequest listRequest , AsyncMethodCallback resultHandler )
2343
- throws TException {}
2368
+ throws TException {
2369
+ throw new UnsupportedOperationException ("not implemented" );
2370
+ }
2344
2371
2345
2372
@ Override
2346
2373
public void ScanWorkflowExecutions (
0 commit comments