The service provider’s thread pool implements the strategy. When the server receives a request, it needs to create a thread in the thread pool to execute the service provider’s business logic.
org.apache.dubbo.common.threadpool.ThreadPool
<dubbo:protocol threadpool="xxx" />
<!-- Default value setting, when <dubbo:protocol> does not configure threadpool, use this configuration -->
<dubbo:provider threadpool="xxx" />
org.apache.dubbo.common.threadpool.FixedThreadPool
org.apache.dubbo.common.threadpool.CachedThreadPool
Maven project structure:
src
|-main
|-java
|-com
|-xxx
|-XxxThreadPool.java (implement ThreadPool interface)
|-resources
|-META-INF
|-dubbo
|-org.apache.dubbo.common.threadpool.ThreadPool (plain text file, content: xxx=com.xxx.XxxThreadPool)
XxxThreadPool.java:
package com.xxx;
import org.apache.dubbo.common.threadpool.ThreadPool;
import java.util.concurrent.Executor;
public class XxxThreadPool implements ThreadPool {
public Executor getExecutor() {
//...
}
}
META-INF/dubbo/org.apache.dubbo.common.threadpool.ThreadPool:
xxx=com.xxx.XxxThreadPool