@@ -128,7 +128,10 @@ public class WorkflowServiceTChannel implements IWorkflowService {
128128 private static final long DEFAULT_POLL_RPC_TIMEOUT_MILLIS = 121 * 1000 ;
129129
130130 /** 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 ;
132135
133136 private static final String DEFAULT_CLIENT_APP_NAME = "cadence-client" ;
134137
@@ -148,6 +151,9 @@ public static class ClientOptions {
148151 /** The tChannel timeout for query workflow call in milliseconds */
149152 private final long rpcQueryTimeoutMillis ;
150153
154+ /** The tChannel timeout for list archived workflow call in milliseconds */
155+ private final long rpcListArchivedWorkflowTimeoutMillis ;
156+
151157 /** TChannel service name that the Cadence service was started with. */
152158 private final String serviceName ;
153159
@@ -177,6 +183,7 @@ private ClientOptions(Builder builder) {
177183 }
178184 this .rpcLongPollTimeoutMillis = builder .rpcLongPollTimeoutMillis ;
179185 this .rpcQueryTimeoutMillis = builder .rpcQueryTimeoutMillis ;
186+ this .rpcListArchivedWorkflowTimeoutMillis = builder .rpcListArchivedWorkflowTimeoutMillis ;
180187 if (builder .metricsScope == null ) {
181188 builder .metricsScope = NoopScope .getInstance ();
182189 }
@@ -209,6 +216,11 @@ public long getRpcQueryTimeoutMillis() {
209216 return rpcQueryTimeoutMillis ;
210217 }
211218
219+ /** @return Returns the rpc timout for list archived workflow requests in millis. */
220+ public long getRpcListArchivedWorkflowTimeoutMillis () {
221+ return rpcListArchivedWorkflowTimeoutMillis ;
222+ }
223+
212224 /** Returns the client application name. */
213225 public String getClientAppName () {
214226 return this .clientAppName ;
@@ -242,6 +254,8 @@ public static class Builder {
242254 private long rpcTimeoutMillis = DEFAULT_RPC_TIMEOUT_MILLIS ;
243255 private long rpcLongPollTimeoutMillis = DEFAULT_POLL_RPC_TIMEOUT_MILLIS ;
244256 public long rpcQueryTimeoutMillis = DEFAULT_QUERY_RPC_TIMEOUT_MILLIS ;
257+ public long rpcListArchivedWorkflowTimeoutMillis =
258+ DEFAULT_LIST_ARCHIVED_WORKFLOW_TIMEOUT_MILLIS ;
245259 public String serviceName ;
246260 private Scope metricsScope ;
247261 private Map <String , String > transportHeaders ;
@@ -279,6 +293,16 @@ public Builder setQueryRpcTimeout(long timeoutMillis) {
279293 return this ;
280294 }
281295
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+
282306 /**
283307 * Sets the client application name.
284308 *
@@ -1717,7 +1741,8 @@ private ListArchivedWorkflowExecutionsResponse listArchivedWorkflowExecutions(
17171741 ThriftRequest <WorkflowService .ListArchivedWorkflowExecutions_args > request =
17181742 buildThriftRequest (
17191743 "ListArchivedWorkflowExecutions" ,
1720- new WorkflowService .ListArchivedWorkflowExecutions_args (listRequest ));
1744+ new WorkflowService .ListArchivedWorkflowExecutions_args (listRequest ),
1745+ options .getRpcListArchivedWorkflowTimeoutMillis ());
17211746 response = doRemoteCall (request );
17221747 WorkflowService .ListArchivedWorkflowExecutions_result result =
17231748 response .getBody (WorkflowService .ListArchivedWorkflowExecutions_result .class );
@@ -2340,7 +2365,9 @@ public void ListWorkflowExecutions(
23402365 @ Override
23412366 public void ListArchivedWorkflowExecutions (
23422367 ListArchivedWorkflowExecutionsRequest listRequest , AsyncMethodCallback resultHandler )
2343- throws TException {}
2368+ throws TException {
2369+ throw new UnsupportedOperationException ("not implemented" );
2370+ }
23442371
23452372 @ Override
23462373 public void ScanWorkflowExecutions (
0 commit comments