SimpleAsyncTaskExecutor not releasing threads

I am running several spring batch partitioning jobs from within the same JVM instance. Each is configured to use 3 threads but every time a new job starts I see in the logs that SimpleAsyncTaskExecutor keeps increasing its thread number.

so first jobs shows:

09:53:02.370 [SimpleAsyncTaskExecutor-1] INFO...
09:53:02.370 [SimpleAsyncTaskExecutor-2] INFO...

and next jobs shows:

09:53:02.370 [SimpleAsyncTaskExecutor-3] INFO...
09:53:02.370 [SimpleAsyncTaskExecutor-4] INFO...

I would have expected each new job to use threads 1 and 2 and not create new ones...I am shutting down the job each time but can post code if needed.

Upvotes: 3

Views: 4172

Answers (1)

Related Questions