group增加nodes属性
This commit is contained in:
@@ -11,9 +11,9 @@
|
||||
|类型|使用注解|场景说明|
|
||||
| --- | --- | --- |
|
||||
|默认加载|```@AutoLoad```或无注解|默认的Service会自动加载并初始化,且会自动生成对应协议层Servlet|
|
||||
|依赖加载|```@AutoLoad(false)```|此类Service只有被其他服务依赖或者显式的配置时才会被初始化,主要用于工具类功能服务, 比如```DataSource```、```CacheSource```|
|
||||
|本地模式|```@Local```|此类Service无论配不配成远程模式,都不会转成远程模式,主要用于功能依赖本地环境或者参数无法序列化的服务|
|
||||
|组件模式|```@Component```|此类Service不会被动态生成协议层Servlet,主要用于无需提供对进程外提供接口的服务, 比如```DataSource```、```CacheSource```的实现|
|
||||
|依赖加载|```@AutoLoad(false)```|此类Service只有被其他服务依赖或者显式的配置时才会被初始化,<br> 主要用于工具类功能服务, <br> 比如```DataSource```、```CacheSource```|
|
||||
|本地模式|```@Local```|此类Service无论配不配成远程模式,都不会转成远程模式,<br>主要用于功能依赖本地环境或者参数无法序列化的服务|
|
||||
|组件模式|```@Component```|此类Service不会被动态生成协议层Servlet,<br>主要用于无需提供对进程外提供接口的服务,<br> 比如```DataSource```、```CacheSource```的实现|
|
||||
# 基本用法
|
||||
```java
|
||||
@RestService(comment = "用户服务模块")
|
||||
@@ -52,11 +52,8 @@ public class UserService implements Service {
|
||||
## 远程模式Service
|
||||
  远程Servie其实是提供RPC接口,需要配置文件中显式配置才可使用远程模式。
|
||||
```xml
|
||||
<group name="remote-A">
|
||||
<node addr="192.168.10.111" port="7070"/>
|
||||
<node addr="192.168.10.112" port="7070"/>
|
||||
</group>
|
||||
|
||||
<group name="remote-A" nodes="192.168.10.111:7070,192.168.10.112:7070"/>
|
||||
|
||||
<server protocol="HTTP" host="0.0.0.0" port="8080">
|
||||
<services autoload="true" group="remote-A"/>
|
||||
<service name="" value="org.redkale.demo.user.UserService" group="remote-A"/>
|
||||
|
||||
Reference in New Issue
Block a user