Skip to content

Commit 1ff04d5

Browse files
committed
Deprecate throttle limit in TaskExecutorRepeatTemplate
Resolves #2218
1 parent 157d7a3 commit 1ff04d5

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

spring-batch-core/src/main/java/org/springframework/batch/core/step/builder/AbstractTaskletStepBuilder.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,11 @@ public B taskExecutor(TaskExecutor taskExecutor) {
199199
* in the job repository for this step.
200200
* @param throttleLimit maximum number of concurrent tasklet executions allowed
201201
* @return this for fluent chaining
202+
* @deprecated since 5.0, scheduled for removal in 6.0. Use a pooled
203+
* {@link TaskExecutor} implemenation with a limited capacity of its task queue
204+
* instead.
202205
*/
206+
@Deprecated(since = "5.0", forRemoval = true)
203207
public B throttleLimit(int throttleLimit) {
204208
this.throttleLimit = throttleLimit;
205209
return self();
@@ -280,6 +284,7 @@ protected TaskExecutor getTaskExecutor() {
280284
return taskExecutor;
281285
}
282286

287+
@Deprecated(since = "5.0", forRemoval = true)
283288
protected int getThrottleLimit() {
284289
return throttleLimit;
285290
}

spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/TaskExecutorRepeatTemplate.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2006-2007 the original author or authors.
2+
* Copyright 2006-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -43,6 +43,7 @@
4343
* any given time, and each thread would have its own transaction).<br>
4444
*
4545
* @author Dave Syer
46+
* @author Mahmoud Ben Hassine
4647
*
4748
*/
4849
public class TaskExecutorRepeatTemplate extends RepeatTemplate {
@@ -68,7 +69,11 @@ public class TaskExecutorRepeatTemplate extends RepeatTemplate {
6869
* being reached (so make the core pool size larger than the throttle limit if
6970
* possible).
7071
* @param throttleLimit the throttleLimit to set.
72+
* @deprecated since 5.0, scheduled for removal in 6.0. Use a pooled
73+
* {@link TaskExecutor} implemenation with a limited capacity of its task queue
74+
* instead.
7175
*/
76+
@Deprecated(since = "5.0", forRemoval = true)
7277
public void setThrottleLimit(int throttleLimit) {
7378
this.throttleLimit = throttleLimit;
7479
}

0 commit comments

Comments
 (0)