10 Ağustos 2020 Pazartesi

SpringAsync application.properties Ayarları

Giriş
Ayarlar spring.task.execution ve spring.task.scheduling başlıkları altında

Örnek
Şöyle yaparız
# Core number of threads. Default is 8
spring.task.execution.pool.core-size=10

# Maximum allowed number of threads. Default is 1
spring.task.scheduling.pool.size=5
Örnek
Şöyle yaparız
spring.task.execution.pool.max-size=16
spring.task.execution.pool.queue-capacity=100
spring.task.execution.pool.keep-alive=10s
Açıklaması şöyle
This changes the thread pool to use a bounded queue so that when the queue is full (100 tasks), the thread pool increases to maximum 16 threads. Shrinking of the pool is more aggressive as threads are reclaimed when they are idle for 10 seconds (rather than 60 seconds by default).
Örnek
Şöyle yaparız
#Number of core threads
spring.task.execution.pool.core-size=10
#Maximum number of threads
spring.task.execution.pool.max-size=20
#Thread name prefix
spring.task.execution.thread-name-prefix=test
#There are other configurations that readers can configure themselves

Hiç yorum yok:

Yorum Gönder