dubbo:provider

dubbo:provider element

The default configuration of service provider. The corresponding class is org.apache.dubbo.config.ProviderConfig. This tag provider default values for <dubbo:service> and <dubbo:protocol>.

AttributeCorresponding URL parameterTypeRequiredDefault ValueFunctionDescriptionCompatibility
idstringFalsedubboConfiguration associationBean Id of the protocol, can be referenced in <dubbo:service proivder="">Above 1.0.16
protocol<protocol>stringFalsedubboPerformance optimizeProtocol nameAbove 1.0.16
host<host>stringFalseFind local IP automaticallyService discoveryThe host name of services, to specify VIP and domain, or having multiple network cards. If null, it will find local IP automatically. It’s recommended to let Dubbo find local IP automaticallyAbove 1.0.16
threadsthreadsintFalse200Performance optimizeThe size of the services' Thread Pool(Fixed)Above 1.0.16
payloadpayloadintFalse8388608(=8M)Performance optimizeThe length limit of request and response, unit is byteAbove 2.0.0
path<path>stringFalseService discoveryContext path of the service provider, the prefix of the service pathAbove 2.0.0
serverserverstringFalseDefault is netty for dubbo protocol, servlet for http protocolPerformance optimizeThe server implement of the protocol. For example, mina and netty for dubbo ptotocol, jetty and servlet for http protocol.Above 2.0.0
clientclientstringFalseDefault is netty for dubbo protocolPerformance optimizeThe client implement of the protocol. For example, mina and netty for dubbo protocol.Above 2.0.0
codeccodecstringFalsedubboPerformance optimizeProtocol encodingAbove 2.0.0
serializationserializationstringFalseDefault is hessian2 for dubbo protocol, json for http protocolPerformance optimizeProtocol serialization, It’s used when a protocol has multiple serializations. For example, dubbo protocol has 4 serializations, they are dubbo, hessian2, java and compactedjava, http protocol has json and xml.Above 2.0.5
defaultbooleanFalsefalseConfiguration associationTo specify the default protocol for support multiple protocols.Above 1.0.16
filterservice.filterstringFalsePerformance optimizeThe filter name of the RPC process of the provider, use , to separate multiple filter names.Above 2.0.5
listenerexporter.listenerstringFalsePerformance optimizeThe listener name of the provider, use , to separate multiple listener names.Above 2.0.5
threadpoolthreadpoolstringFalsefixedPerformance optimizeThe type of Thread Pool, fixed/cached are availableAbove 2.0.5
acceptsacceptsintFalse0Performance optimizeThe maximum connection count of the service providerAbove 2.0.5
versionversionstringFalse0.0.0Service discoveryService version. It’s recommended to use 2 digitals such as 1.0. It’s necessary to upgrade version only when the service is not compatible.Above 2.0.5
groupgroupstringFalseService discoveryThe group of the service providers. It can distinguish services when it has multiple implements.Above 2.0.5
delaydelayintFalse0Performance optimizeThe delay time(ms) for registering services. When set to -1, it indicates that the services will expose to registry after the Spring context is initializedAbove 2.0.5
timeoutdefault.timeoutintFalse1000Performance optimizeThe RPC timeout(ms)Above 2.0.5
retriesdefault.retriesintFalse2Performance optimizeThe retry count for RPC, not including the first invoke. Please set it to 0 if don’t need to retry.Above 2.0.5
connectionsdefault.connectionsintFalse0Performance optimizeThe maximum connections of every provider. For short connection such as rmi, http and hessian, it’s connection limit, but for long connection such as dubbo, it’s connection count.Above 2.0.5
loadbalancedefault.loadbalancestringFalserandomPerformance optimizeStrategy of load balance, random, roundrobin and leastactive are available.Above 2.0.5
asyncdefault.asyncbooleanFalsefalsePerformance optimizeAsynchronous execution, not reliable. It does not block the execution thread just only ignores the return value.Above 2.0.5
stubstubbooleanFalsefalseService governancetrue means use the default proxy class name, which is the interface name with Local as the suffix.Above 2.0.5
mockmockbooleanFalsefalseService governancetrue means use the default mock class name, which is the interface name with Mock suffix.Above 2.0.5
tokentokenbooleanFalsefalseService governanceEnable token validation. Disable token if it’s null. It will generate token randomly when it is enable.Above 2.0.5
registryregistrystringFalseBy default, register to all registriesConfiguration associationRegister services to specified registry while having multiple registries. It is the id value of the <dubbo:registry>. If don’t want to register to any registry, set it as N/AAbove 2.0.5
dynamicdynamicbooleanFalsetrueService governanceWhether the service is registered dynamically. If false, services will be showed as disable, you need to enable it manually. And you also need to disable it when provider shut down.Above 2.0.5
accesslogaccesslogstring/booleanFalsefalseService governancetrue will write access log to logger. Specifying it to a log path, you can write access logs to special log file.Above 2.0.5
ownerownerstringFalseService governanceThe owner of the service. It’s used for service governance.Above 2.0.5
documentdocumentstringFalseService governanceService document URLAbove 2.0.5
weightweightintFalsePerformance optimizeThe weight of the serviceAbove 2.0.5
executesexecutesintFalse0Performance optimizeThe maximum parallel execution request count per method per service for the provider.Above 2.0.5
activesdefault.activesintFalse0Performance optimizeThe maximum concurrent calls per method per service of the consumer.Above 2.0.5
proxyproxystringFalsejavassistPerformance optimizeThe proxy implement, jdk/javassist are available.Above 2.0.5
clusterdefault.clusterstringFalsefailoverPerformance optimizefailover/failfast/failsafe/failback/forking are available.Above 2.0.5
deprecateddeprecatedbooleanFalsefalseService governanceMark the service is deprecated. If true, there will log an error log on the client side.Above 2.0.5
queuesqueuesintFalse0Performance optimizeThe queue size of the Thread Pool. It’s recommended not to specify it in order to invoke other provides rather than queueing unless you have special requirement.Above 2.0.5
charsetcharsetstringFalseUTF-8Performance optimizeSerialization encodingAbove 2.0.5
bufferbufferintFalse8192Performance optimizeThe buffer size of networking IOAbove 2.0.5
iothreadsiothreadsintFalseCPU + 1Performance optimizeThe size of io Thread Pool(Fixed). These threads are used to receive, serialize and deserialize IO data. See threads for configuring business thread pool. It’s not recommended to configure this.Above 2.0.5
telnettelnetstringFalseService governanceSupported telnet commands, use , to separate commands.Above 2.0.5
contextpathcontextpathStringFalseEmpty stringService governance
layerlayerstringFalseService governanceThe biz layer of the service provider, such as biz, dao, intl:web and china:acton.Above 2.0.7

Last modified November 25, 2020: fix sample code issue for SPI.md (#659) (0576d68)