How to use Pooled Spring beans instead of Singleton ones?

前端 未结 5 1477
后悔当初
后悔当初 2021-01-14 16:45

For efficiency reasons, I am interested in limiting the number of threads that simultaneously uses the beans of the Spring application context (I don\'t want an unli

5条回答
  •  轮回少年
    2021-01-14 17:21

    I'm pretty sure you can limit the number of simultaneous threads in a less convoluted way. Did you look at the Java Concurrency API, specifically at the Executors.newFixedThreadPool() ?

提交回复
热议问题