From 42eee7afc62ad53b875ee0c67520458f1f739f4e Mon Sep 17 00:00:00 2001 From: Shinnosuke Okada Date: Fri, 23 Oct 2020 14:55:24 -0400 Subject: [PATCH] Pass taskListActivitiesPerSecond down to ActivityWorker --- src/main/java/com/uber/cadence/worker/Worker.java | 5 +++-- src/main/java/com/uber/cadence/worker/WorkerOptions.java | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/uber/cadence/worker/Worker.java b/src/main/java/com/uber/cadence/worker/Worker.java index a9e68b3d8..a1621704c 100644 --- a/src/main/java/com/uber/cadence/worker/Worker.java +++ b/src/main/java/com/uber/cadence/worker/Worker.java @@ -141,12 +141,13 @@ private static SingleWorkerOptions toActivityOptions( .put(MetricsTag.TASK_LIST, taskList) .build(); return new SingleWorkerOptions.Builder() - .setDataConverter(options.getDataConverter()) .setIdentity(options.getIdentity()) + .setDataConverter(options.getDataConverter()) + .setTaskExecutorThreadPoolSize(options.getMaxConcurrentActivityExecutionSize()) + .setTaskListActivitiesPerSecond(options.getTaskListActivitiesPerSecond()) .setPollerOptions(options.getActivityPollerOptions()) .setReportCompletionRetryOptions(options.getReportActivityCompletionRetryOptions()) .setReportFailureRetryOptions(options.getReportActivityFailureRetryOptions()) - .setTaskExecutorThreadPoolSize(options.getMaxConcurrentActivityExecutionSize()) .setMetricsScope(options.getMetricsScope().tagged(tags)) .setEnableLoggingInReplay(options.getEnableLoggingInReplay()) .setContextPropagators(contextPropagators) diff --git a/src/main/java/com/uber/cadence/worker/WorkerOptions.java b/src/main/java/com/uber/cadence/worker/WorkerOptions.java index dacc41243..7741757c2 100644 --- a/src/main/java/com/uber/cadence/worker/WorkerOptions.java +++ b/src/main/java/com/uber/cadence/worker/WorkerOptions.java @@ -281,6 +281,10 @@ public int getMaxConcurrentLocalActivityExecutionSize() { return maxConcurrentLocalActivityExecutionSize; } + public double getTaskListActivitiesPerSecond() { + return taskListActivitiesPerSecond; + } + public PollerOptions getActivityPollerOptions() { return activityPollerOptions; }