Spring ThreadPoolTaskExecutor only running one thread

前端 未结 4 1767
春和景丽
春和景丽 2020-12-13 00:51

We are using ThreadPoolExecutor in our JMS consumer and injecting it into a DefaultMessageListenerContainer. I expect this to be running concurrent threads for many messages

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-13 01:24

    try this:

    
            
            
            
    
    
    • This will create 10 threads at the time of initialization.
    • If all 10 threads are busy and new task comes up, then It will keep tasks in queue.
    • If queue is full it will create 11th thread and will go till 25.
    • Then will throw TaskRejected Exception.

提交回复
热议问题