All Products
Search
Document Center

RPC Configuration Class

Last Updated: Aug 21, 2020

ProviderConfig

Attribute Description Default value Remarks
id The ID. Automatically generated
application The application object. null ApplicationConfig
interfaceId The unique service interface ID. It is set to the actual interface class for both common calls and return calls.
uniqueId The unique service tag ID.
filterRef The configured filter instance. List
filter The configured filter alias. Separate multiple aliases with a comma (,).
registry The server registry. List
methods The method-level configuration. Map<String, MethodConfig>
serialization The serialization protocol. hessian2
register Specifies whether to perform registration. true It depends on the implementation and may not take effects.
subscribe Specifies whether to perform subscription. true It depends on the implementation and may not take effects.
proxy The proxy type. javassist The JDK dynamic proxy is also included.
ref The service interface implementation class.
server The server. This attribute is of the List type, indicating that a request can be sent to multiple servers at a time.
delay The delayed time of service publication. The service is delayed.
weight The static weight of a service.
include The methods included.
exclude The methods excluded.
dynamic Specifies whether to perform dynamic registration.
priority The service priority.
bootstrap The service publication initiator. bolt
executor The custom thread pool.
timeout The server execution timeout period.
concurrents The maximum number of concurrent requests. The maximum number of concurrent requests of a method under an interface. -1 indicates that the concurrency filter is disabled; 0 indicates that the filter is enabled but without any limits.
cacheRef The result cache implementation class.
mockRef The Mock implementation class.
mock Specifies whether to enable Mock.
validation Specifies whether to enable parameter verification (jsr303).
compress Specifies whether to enable compression. false
cache Specifies whether to enable result cache. false
parameters The additional attributes. Map<String, String>

ConsumerConfig

Attribute Description Default value Remarks
id The ID. Automatically generated
application The application object. null ApplicationConfig
interfaceId The unique service interface ID. It is set to the actual interface class for both common calls and return calls.
uniqueId The unique service tag ID.
filterRef The configured filter instance. List
filter The configured filter alias List
registry The server registry. List
methods The method-level configuration. Map<String, MethodConfig>
serialization The serialization protocol. hessian2
register Specifies whether to perform registration. true It depends on the implementation and may not take effects.
subscribe Specifies whether to perform subscription. true It depends on the implementation and may not take effects.
proxy The proxy type. javassist The JDK dynamic proxy is also included.
protocol The calling protocol. bolt Currently, Bolt, REST, and Dubbo protocols are supported.
directUrl The direct connection URL. Register after direct connection.
generic Specifies whether to generalize the call. false
connectTimeout The connection timeout period. 3000 (cover 5000)
disconnectTimeout The disconnection timeout period. 5000 (cover 10000)
cluster The cluster mode. failover
connectionHolder The implementation of the connection holder. all
loadBalancer The SLB algorithm. random
lazy Specifies whether to delay the establishment of the persistent connection. false
sticky Specifies whether to use the sticky connection. false Skip the SLB algorithm and use the preceding address.
inJVM Specifies whether to switch to a JVM call. true Switch to a local call if JVM discovers a service provider.
Check Specifies whether to check strong dependencies. false If no server is available, the startup fails.
heartbeat The heartbeat interval. 30,000 The client sends the heartbeat interval to the server. It depends on the implementation and may not take effects.
reconnect The reconnection interval. 10000 The interval at which the client reestablishes the persistent connection to a port. It depends on the implementation and may not take effects.
router The configured router alias. List
routerRef The configured router instance. List
bootstrap The service reference initiator. bolt
addressWait The waiting time before obtaining the address. -1 It depends on the implementation and may not take effects.
timeout The calling timeout period. 3000 (cover 5000)
retries The number of retries after the operation failed. 0 The parameter depends on the cluster mode. If the mode is set to failover, this parameter is read.
invokeType The call type. sync
onReturn The maximum number of concurrent requests. Maximum number of concurrent requests executed by a method under an interface.
-1 indicates that the concurrency filter is disabled, and 0 indicates that the filter is enabled but without any limits.
cacheRef The result cache implementation class.
mockRef The Mock implementation class.
cache Specifies whether to enable the result cache. false
mock Specifies whether to enable Mock.
validation Specifies whether to enable parameter verification. It is based on JSR303.
compress Specifies whether to enable compression. false
parameters The additional attributes. Map<String, String>

MethodConfig

Attribute Description Default value Remarks
name The method name.
timeout The calling timeout period. null
retries The number of retries after the operation failed. null
invokeType The call type. null
validation Specifies whether to enable parameter verification. null It is based on JSR303.
onReturn The SofaResponseCallback called when a response is returned. null It is used to implement the callback method.
concurrent The maximum number of concurrent requests. null Maximum number of concurrent requests executed by a method under an interface. -1 indicates that the concurrency filter is disabled, and 0 indicates that the filter is enabled but without any limits.
validation Specifies whether to enable parameter verification. null
compress Specifies whether to enable compression. null
parameters The additional attributes. Map<String, String>

ServerConfig

Attribute Description Default value Remarks
protocol The protocol. bolt Currently, Bolt, REST, and Dubbo protocols are supported.
host The host. 0.0.0.0
port The port. 12200 Default ports: 12200 for Bolt, 8341 for REST, 12300 for H2C, and 20880 for Dubbo
contextPath The context path. /
ioThreads The number of I/O thread pools. 0 It depends on the implementation and may not take effect. For example, the default value for Bolt is CPU × 2. 0 indicates the value is calculated automatically.
threadPoolType The business thread pool type. cached
coreThreads The number of core threads in a business thread pool. 80 (override 20)
maxThreads The maximum number of threads in a business thread pool. 400 (override 200)
telnet Specifies whether Telnet is supported. true It depends on the implementation and may not take effect. For example, Telnet is not supported for Bolt.
queueType The queue type in a business thread pool. normal Valid values also include priority.
queues The number of queues in a business thread pool. 1000 (override 0)
aliveTime The alive time of a business thread pool. 300000 (override 60000)
preStartCore The ID. Automatically generated
accepts The maximum number of persistent connections. 100000 It depends on the implementation and may not take effect.
serialization The serialization protocol. hesisan2
virtualHost The virtual host address. It is the preferred address when the service is registered in the registry.
virtualPort The virtual host port. It is the preferred port when the service is registered in the registry.
epoll Specifies whether to enable. false It depends on the implementation and may not take effect.
daemon Specifies whether to hold the port. true If the value is true, the system releases the port when the main thread is closed. If the value is false, the port needs to be manually released.
adaptivePort Specifies whether to adjust the port. false When the port is occupied, the port number is incremented by 1.
transport The implementation of the transport layer. bolt (cover netty4) It depends on the implementation and may not take effect.
autoStart Specifies whether to automatically start the port. true
stopTimeout The graceful shutdown timeout period, in ms. 10000 (override 20000)
boundHost The bound address. It is the address of the host by default.
parameters The additional attributes. Map<String, String>

RegistryConfig

Attribute Description Default value Remarks
protocol The protocol. zookeeper Currently, valid values include zookeeper and local.
address The registry address. Either this attribute or the index attribute must be set.
index The addressing service address of the registry. Either this attribute or the address attribute must be set.
register Specifies whether to register the service. true
subscribe Specifies whether to subscribe to the service. true
timeout The timeout period of calling the registry. 10s
connectTimeout The timeout period of connecting the registry. 20s
file The location of the local file used when the Local protocol is used. $HOME