Announcement Announcement Module
Collapse
No announcement yet.
Issue with number of threads while using SimpleAsyncTaskExecutor Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Issue with number of threads while using SimpleAsyncTaskExecutor

    Hi,

    We are currently using the SimpleAsyncTaskExecutor within our batch application whereby the concurrencyLimit is configurable using a job parameter as shown below:

    Code:
    <bean id="taskExecutor" class="org.springframework.core.task.SimpleAsyncTaskExecutor" scope="step">  
        	<!-->property name="concurrencyLimit" value="10"/--> 
        	<property name="concurrencyLimit" value="#{jobParameters[numberOfTreads]}"/>   
        </bean>
    We have noticed odd thing while profiling the application in the sense that more that one thread has been seen running (up to 4 threads with limit set to 0)

    Any explanation on this?

    Thanks

  • #2
    Originally posted by kissen View Post
    Any explanation on this?
    A quick look at the source code for SimpleAsyncTaskExecutor confirms that concurrencyLimit=0 switches off the concurrency limit because isThrottleActive() checks for >0 (-1 is the default). I'm not sure what you expect to happen if you set the limit to 0 - it doesn't make a lot of sense, so you are lucky it does anything at all.

    Comment

    Working...
    X