@Documented @Retention(value=RUNTIME) @Target(value={TYPE,METHOD}) @Inherited public @interface DubboService
@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.| Modifier and Type | Optional Element and Description |
|---|---|
String |
accesslog
Access log for the service, default value is empty string
|
int |
actives
Maximum active requests allowed, default value is -1
|
String |
application
Deprecated.
This attribute was deprecated, use bind application/module of spring ApplicationContext
|
boolean |
async
Whether to enable async invocation, default value is false
|
String |
cache
Specify cache implementation for service invocation, legal values include: lru, threadlocal, jcache
|
int |
callbacks
The callback instance limit peer connection
|
String |
cluster
Cluster strategy, legal values include: failover, failfast, failsafe, failback, forking
you can use
ClusterRules.FAIL_FAST …… |
int |
connections
Maximum connections service provider can accept, default value is -1 - connection is shared
|
int |
delay
Delay time for service registration, default value is -1
|
boolean |
deprecated
Whether the service is deprecated, default value is false
|
String |
document
Service doc, default value is empty string
|
boolean |
dynamic
Whether the service is dynamic, default value is true
|
int |
executes
Maximum concurrent executes for the service, default value is -1 - no limits
|
String |
executor
bean name of service executor(thread pool), used for thread pool isolation between services
|
boolean |
export
Whether to export service, default value is true
|
boolean |
exportAsync
Weather the service is export asynchronously
|
String[] |
filter
Filters for service invocation
|
String |
group
Service group, default value is empty string
|
Class<?> |
interfaceClass
Interface class, default value is void.class
|
String |
interfaceName
Interface class name, default value is empty string
|
String |
layer
Service layer, default value is empty string
|
String[] |
listener
Listeners for service exporting and unexporting
|
String |
loadbalance
Load balance strategy, legal values include: random, roundrobin, leastactive
you can use
LoadbalanceRules.RANDOM …… |
String |
local
Deprecated.
|
Method[] |
methods
methods support
|
String |
mock
Service mock name, use interface name + Mock if not set
|
String |
module
Module spring bean name
|
String |
monitor
Monitor spring bean name
|
String |
onconnect
Callback method name when connected, default value is empty string
|
String |
ondisconnect
Callback method name when disconnected, default value is empty string
|
String |
owner
Service owner, default value is empty string
|
String[] |
parameters
Customized parameter key-value pair, for example: {key1, value1, key2, value2}
|
String |
path
Service path, default value is empty string
|
String |
payload
Payload max length.
|
String[] |
protocol
Protocol spring bean names
|
String |
provider
Provider spring bean name
|
String |
proxy
How the proxy is generated, legal values include: jdk, javassist
|
boolean |
register
Whether to register the service to register center, default value is true
|
String[] |
registry
Registry spring bean name
|
int |
retries
Service invocation retry times
|
String |
scope
the scope for referring/exporting a service, if it's local, it means searching in current JVM only.
|
boolean |
sent
Whether the async request has already been sent, the default value is false
|
String |
stub
Service stub name, use interface name + Local if not set
|
String |
tag
Service tag name
|
int |
timeout
Timeout value for service invocation, default value is -1
|
String |
token
Service token, default value is empty string
|
String |
validation
Whether to use JSR303 validation, legal values are: true, false
|
String |
version
Service version, default value is empty string
|
int |
weight
Service weight value, default value is -1
|
public abstract Class<?> interfaceClass
public abstract String interfaceName
public abstract String version
public abstract String group
public abstract String path
public abstract boolean export
public abstract String token
public abstract boolean deprecated
public abstract boolean dynamic
public abstract String accesslog
public abstract int executes
public abstract boolean register
public abstract String document
public abstract int delay
public abstract String stub
public abstract String cluster
ClusterRules.FAIL_FAST ……public abstract String proxy
public abstract int connections
public abstract int callbacks
see org.apache.dubbo.common.constants.CommonConstants.DEFAULT_CALLBACK_INSTANCES
public abstract String onconnect
public abstract String ondisconnect
public abstract String owner
public abstract String layer
public abstract int retries
CommonConstants.DEFAULT_RETRIESpublic abstract String loadbalance
LoadbalanceRules.RANDOM ……public abstract boolean async
public abstract int actives
public abstract boolean sent
public abstract String mock
public abstract String validation
public abstract int timeout
public abstract String cache
public abstract String[] filter
Filterpublic abstract String[] listener
ExporterListenerpublic abstract String[] parameters
@Deprecated public abstract String application
public abstract String module
public abstract String provider
public abstract String[] protocol
public abstract String monitor
public abstract String[] registry
public abstract String tag
public abstract Method[] methods
public abstract String scope
org.apache.dubbo.rpc.Constants#SCOPE_LOCAL,
org.apache.dubbo.rpc.Constants#SCOPE_REMOTEpublic abstract boolean exportAsync
public abstract String executor
public abstract String payload
Copyright © 2011–2020 The Apache Software Foundation. All rights reserved.