Annotation Type DubboService
Class-level annotation used for declaring Dubbo service.
1. Using with java config bean:
This usage is recommended.
It is more flexible on bean methods than on implementation classes, and is more compatible with Spring.
It is more flexible on bean methods than on implementation classes, and is more compatible with Spring.
@Configuration
class ProviderConfiguration {
@Bean
@DubboService(group="demo")
public DemoService demoServiceImpl() {
return new DemoServiceImpl();
}
}
2. Using on implementation class of service:
@DubboService(group="demo")
public class DemoServiceImpl implements DemoService {
...
}
This usage causes the implementation class to rely on the Dubbo module.- Since:
- 2.7.7
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionAccess log for the service, default value is empty stringintMaximum active requests allowed, default value is -1Deprecated.This attribute was deprecated, use bind application/module of spring ApplicationContextbooleanWhether to enable async invocation, default value is falseSpecify cache implementation for service invocation, legal values include: lru, threadlocal, jcacheintThe callback instance limit peer connectionCluster strategy, legal values include: failover, failfast, failsafe, failback, forking you can useClusterRules.FAIL_FAST……intMaximum connections service provider can accept, default value is -1 - connection is sharedintDelay time for service registration, default value is -1booleanWhether the service is deprecated, default value is falseService doc, default value is empty stringbooleanWhether the service is dynamic, default value is trueintMaximum concurrent executes for the service, default value is -1 - no limitsbean name of service executor(thread pool), used for thread pool isolation between servicesbooleanWhether to export service, default value is truebooleanWeather the service is export asynchronouslyString[]Filters for service invocationService group, default value is empty stringClass<?> Interface class, default value is void.classInterface class name, default value is empty stringService layer, default value is empty stringString[]Listeners for service exporting and unexportingLoad balance strategy, legal values include: random, roundrobin, leastactive you can useLoadbalanceRules.RANDOM……Deprecated.Method[]methods supportService mock name, use interface name + Mock if not setModule spring bean nameMonitor spring bean nameCallback method name when connected, default value is empty stringCallback method name when disconnected, default value is empty stringService owner, default value is empty stringString[]Customized parameter key-value pair, for example:Service path, default value is empty stringPayload max length.If the parameter has a value, the consumer will read the parameter first.String[]Protocol spring bean namesProvider spring bean nameHow the proxy is generated, legal values include: jdk, javassistbooleanWhether to register the service to register center, default value is trueString[]Registry spring bean nameintService invocation retry timesthe scope for referring/exporting a service, if it's local, it means searching in current JVM only.booleanWhether the async request has already been sent, the default value is falseThe serialization typeService stub name, use interface name + Local if not setService tag nameintTimeout value for service invocation, default value is -1Service token, default value is empty stringWhether to use JSR303 validation, legal values are: true, falseService version, default value is empty stringintService weight value, default value is -1
-
Element Details
-
interfaceClass
Class<?> interfaceClassInterface class, default value is void.class- Default:
void.class
-
interfaceName
String interfaceNameInterface class name, default value is empty string- Default:
""
-
version
String versionService version, default value is empty string- Default:
""
-
group
String groupService group, default value is empty string- Default:
""
-
path
String pathService path, default value is empty string- Default:
""
-
export
boolean exportWhether to export service, default value is true- Default:
true
-
token
String tokenService token, default value is empty string- Default:
""
-
deprecated
boolean deprecatedWhether the service is deprecated, default value is false- Default:
false
-
dynamic
boolean dynamicWhether the service is dynamic, default value is true- Default:
true
-
accesslog
String accesslogAccess log for the service, default value is empty string- Default:
""
-
executes
int executesMaximum concurrent executes for the service, default value is -1 - no limits- Default:
-1
-
register
boolean registerWhether to register the service to register center, default value is true- Default:
true
-
weight
int weightService weight value, default value is -1- Default:
-1
-
document
String documentService doc, default value is empty string- Default:
""
-
delay
int delayDelay time for service registration, default value is -1- Default:
-1
-
local
String localDeprecated.- See Also:
- Default:
""
-
stub
String stubService stub name, use interface name + Local if not set- Default:
""
-
cluster
String clusterCluster strategy, legal values include: failover, failfast, failsafe, failback, forking you can useClusterRules.FAIL_FAST……- Default:
""
-
proxy
String proxyHow the proxy is generated, legal values include: jdk, javassist- Default:
""
-
connections
int connectionsMaximum connections service provider can accept, default value is -1 - connection is shared- Default:
-1
-
callbacks
int callbacksThe callback instance limit peer connectionsee org.apache.dubbo.common.constants.CommonConstants.DEFAULT_CALLBACK_INSTANCES
- Default:
-1
-
onconnect
String onconnectCallback method name when connected, default value is empty string- Default:
""
-
ondisconnect
String ondisconnectCallback method name when disconnected, default value is empty string- Default:
""
-
owner
String ownerService owner, default value is empty string- Default:
""
-
layer
String layerService layer, default value is empty string- Default:
""
-
retries
int retriesService invocation retry times- See Also:
- Default:
-1
-
loadbalance
String loadbalanceLoad balance strategy, legal values include: random, roundrobin, leastactive you can useLoadbalanceRules.RANDOM……- Default:
""
-
async
boolean asyncWhether to enable async invocation, default value is false- Default:
false
-
actives
int activesMaximum active requests allowed, default value is -1- Default:
-1
-
sent
boolean sentWhether the async request has already been sent, the default value is false- Default:
false
-
mock
String mockService mock name, use interface name + Mock if not set- Default:
""
-
validation
String validationWhether to use JSR303 validation, legal values are: true, false- Default:
""
-
timeout
int timeoutTimeout value for service invocation, default value is -1- Default:
-1
-
cache
String cacheSpecify cache implementation for service invocation, legal values include: lru, threadlocal, jcache- Default:
""
-
filter
String[] filterFilters for service invocation- See Also:
- Default:
{}
-
listener
String[] listenerListeners for service exporting and unexporting- See Also:
- Default:
{}
-
parameters
String[] parametersCustomized parameter key-value pair, for example:["a","b"] ==> {a=b} [" a "," b "] ==> {a=b} ["a=b"] ==>{a=b} ["a:b"] ==>{a=b} ["a=b","c","d"] ==>{a=b,c=d} ["a","a:b"] ==>{a="a:b"} ["a","a,b"] ==>{a="a,b"}- See Also:
- Default:
{}
-
application
Deprecated.This attribute was deprecated, use bind application/module of spring ApplicationContextApplication spring bean name- Default:
""
-
module
String moduleModule spring bean name- Default:
""
-
provider
String providerProvider spring bean name- Default:
""
-
protocol
String[] protocolProtocol spring bean names- Default:
{}
-
monitor
String monitorMonitor spring bean name- Default:
""
-
registry
String[] registryRegistry spring bean name- Default:
{}
-
tag
String tagService tag name- Default:
""
-
methods
Method[] methodsmethods support- Returns:
- Default:
{}
-
scope
String scopethe scope for referring/exporting a service, if it's local, it means searching in current JVM only.- See Also:
- Default:
""
-
exportAsync
boolean exportAsyncWeather the service is export asynchronously- Default:
false
-
executor
String executorbean name of service executor(thread pool), used for thread pool isolation between services- Returns:
- Default:
""
-
payload
String payloadPayload max length.- Default:
""
-
serialization
String serializationThe serialization type- Default:
""
-
preferSerialization
String preferSerializationIf the parameter has a value, the consumer will read the parameter first. If the Dubbo Sdk you are using contains the serialization type, the serialization method specified by the argument is used.When this parameter is null or the serialization type specified by this parameter does not exist in the Dubbo SDK, the serialization type specified by serialization is used. If the Dubbo SDK if still does not exist, the default type of the Dubbo SDK is used. For Dubbo SDK >= 3.2,
preferSerializationtakes precedence overserializationThe configuration supports multiple, which are separated by commas.Such as:
fastjson2,fastjson,hessian2- Default:
""
-