dubbo.properties

Dubbo 将自动加载 classpath 根目录下的dubbo.properties,可以通过JVM启动参数 -Ddubbo.properties.file=xxx.properties 改变缺省配置位置。

启动时检查

注意:是在消费端进行检查服务,格式如下,如果当前服务没有启动,就会报错

  1. <dubbo:reference id="sampleService" check="true" interface="bhz.dubbo.sample.provider.SampleService" />

关闭所有服务的启动时检查 (没有提供者时报错)

  1. <dubbo:consumer check="false" />

关闭注册中心启动时检查 (注册订阅失败时报错)

  1. <dubbo:registry check="false" />

通过 dubbo.properties

  1. dubbo.reference.bhz.dubbo.sample.provider.SampleService.check=false
  2. dubbo.reference.check=false
  3. dubbo.consumer.check=false
  4. dubbo.registry.check=false

配置的含义

  • dubbo.reference.check=false,强制改变所有 reference 的 check 值,就算配置中有声明,也会被覆盖。

  • dubbo.consumer.check=false,是设置 check 的缺省值,如果配置中有显式的声明,如:<dubbo:reference check="true"/>,不会受影响。

  • dubbo.registry.check=false,前面两个都是指订阅成功,但提供者列表是否为空是否报错,如果注册订阅失败时,也允许启动,需使用此选项,将在后台定时重试。

集群容错 默认Failover Cluster

在集群调用失败时,Dubbo 提供了多种容错方案,缺省为 failover 重试。

详见 https://dubbo.gitbooks.io/dubbo-user-book/content/demos/fault-tolerent-strategy.html

集群模式配置

按照以下示例在服务提供方和消费方配置集群模式

  1. <dubbo:service cluster="failsafe" />
  2. <dubbo:reference cluster="failsafe" />

直连提供者

  1. <dubbo:reference id="xxxService" interface="com.alibaba.xxx.XxxService" url="dubbo://localhost:20890" />
  1. java -Dcom.alibaba.xxx.XxxService=dubbo://localhost:20890

只订阅

  1. <dubbo:registry address="10.20.153.10:9090" register="false" />

只注册

  1. <dubbo:registry id="hzRegistry" address="10.20.153.10:9090" />
  2. <dubbo:registry id="qdRegistry" address="10.20.141.150:9090" subscribe="false" />

多协议

Dubbo 允许配置多协议,在不同服务上支持不同协议或者同一服务上同时支持多种协议。

不同服务在性能上适用不同协议进行传输,比如大数据用短连接协议,小数据大并发用长连接协议

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
  5. xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsdhttp://code.alibabatech.com/schema/dubbohttp://code.alibabatech.com/schema/dubbo/dubbo.xsd">
  6. <dubbo:application name="world" />
  7. <dubbo:registry id="registry" address="10.20.141.150:9090" username="admin" password="hello1234" />
  8. <!-- 多协议配置 -->
  9. <dubbo:protocol name="dubbo" port="20880" />
  10. <dubbo:protocol name="hessian" port="8080" />
  11. <!-- 使用多个协议暴露服务 -->
  12. <dubbo:service id="helloService" interface="com.alibaba.hello.api.HelloService" version="1.0.0" protocol="dubbo,hessian" />
  13. </beans>

多协议暴露服务

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
  5. xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsdhttp://code.alibabatech.com/schema/dubbohttp://code.alibabatech.com/schema/dubbo/dubbo.xsd">
  6. <dubbo:application name="world" />
  7. <dubbo:registry id="registry" address="10.20.141.150:9090" username="admin" password="hello1234" />
  8. <!-- 多协议配置 -->
  9. <dubbo:protocol name="dubbo" port="20880" />
  10. <dubbo:protocol name="hessian" port="8080" />
  11. <!-- 使用多个协议暴露服务 -->
  12. <dubbo:service id="helloService" interface="com.alibaba.hello.api.HelloService" version="1.0.0" protocol="dubbo,hessian" />
  13. </beans>

多注册中心

注册
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
  5. xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsdhttp://code.alibabatech.com/schema/dubbohttp://code.alibabatech.com/schema/dubbo/dubbo.xsd">
  6. <dubbo:application name="world" />
  7. <!-- 多注册中心配置 -->
  8. <dubbo:registry id="hangzhouRegistry" address="10.20.141.150:9090" />
  9. <dubbo:registry id="qingdaoRegistry" address="10.20.141.151:9010" default="false" />
  10. <!-- 向多个注册中心注册 -->
  11. <dubbo:service interface="com.alibaba.hello.api.HelloService" version="1.0.0" ref="helloService" registry="hangzhouRegistry,qingdaoRegistry" />
  12. </beans>
使用
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
  5. xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsdhttp://code.alibabatech.com/schema/dubbohttp://code.alibabatech.com/schema/dubbo/dubbo.xsd">
  6. <dubbo:application name="world" />
  7. <!-- 多注册中心配置 -->
  8. <dubbo:registry id="chinaRegistry" address="10.20.141.150:9090" />
  9. <dubbo:registry id="intlRegistry" address="10.20.154.177:9010" default="false" />
  10. <!-- 向中文站注册中心注册 -->
  11. <dubbo:service interface="com.alibaba.hello.api.HelloService" version="1.0.0" ref="helloService" registry="chinaRegistry" />
  12. <!-- 向国际站注册中心注册 -->
  13. <dubbo:service interface="com.alibaba.hello.api.DemoService" version="1.0.0" ref="demoService" registry="intlRegistry" />
  14. </beans>
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
  5. xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsdhttp://code.alibabatech.com/schema/dubbohttp://code.alibabatech.com/schema/dubbo/dubbo.xsd">
  6. <dubbo:application name="world" />
  7. <!-- 多注册中心配置 -->
  8. <dubbo:registry id="chinaRegistry" address="10.20.141.150:9090" />
  9. <dubbo:registry id="intlRegistry" address="10.20.154.177:9010" default="false" />
  10. <!--用 id 区分-->
  11. <!-- 引用中文站服务 -->
  12. <dubbo:reference id="chinaHelloService" interface="com.alibaba.hello.api.HelloService" version="1.0.0" registry="chinaRegistry" />
  13. <!-- 引用国际站站服务 -->
  14. <dubbo:reference id="intlHelloService" interface="com.alibaba.hello.api.HelloService" version="1.0.0" registry="intlRegistry" />
  15. </beans>

服务分组

当一个接口有多种实现时,可以用 group 区分。

服务
  1. <dubbo:service group="feedback" interface="com.xxx.IndexService" />
  2. <dubbo:service group="member" interface="com.xxx.IndexService" />
引用
  1. <!--根据id进行引用-->
  2. <dubbo:reference id="feedbackIndexService" group="feedback" interface="com.xxx.IndexService" />
  3. <dubbo:reference id="memberIndexService" group="member" interface="com.xxx.IndewxService" />
  4. <!--任意组-->
  5. <dubbo:reference id="barService" interface="com.foo.BarService" group="*" />

多版本

就是加version=""字段

分组聚合

按组合并返回结果 1,比如菜单服务,接口一样,但有多种实现,用group区分,现在消费方需从每种group中调用一次返回结果,合并结果返回,这样就可以实现聚合菜单项。

  1. <!--搜索所有分组-->
  2. <dubbo:reference interface="com.xxx.MenuService" group="*" merger="true" />
  3. <!--合并指定分组-->
  4. <dubbo:reference interface="com.xxx.MenuService" group="aaa,bbb" merger="true" />
  5. <!--指定方法合并结果,其它未指定的方法,将只调用一个 Group-->
  6. <dubbo:reference interface="com.xxx.MenuService" group="*">
  7. <dubbo:method name="getMenuItems" merger="true" />
  8. </dubbo:service>
  9. <!--指定合并策略,缺省根据返回值类型自动匹配,如果同一类型有两个合并器时,需指定合并器的名称 2
  10. -->
  11. <dubbo:reference interface="com.xxx.MenuService" group="*">
  12. <dubbo:method name="getMenuItems" merger="mymerge" />
  13. </dubbo:service>

参数验证

https://dubbo.gitbooks.io/dubbo-user-book/content/demos/parameter-validation.html

结果缓存

结果缓存 1,用于加速热门数据的访问速度,Dubbo 提供声明式缓存,以减少用户加缓存的工作量

缓存类型
  • lru 基于最近最少使用原则删除多余缓存,保持最热的数据被缓存。
  • threadlocal 当前线程缓存,比如一个页面渲染,用到很多 portal,每个 portal 都要去查用户信息,通过线程缓存,可以减少这种多余访问。
  • jcache 与 JSR107 集成,可以桥接各种缓存实现。


  1. <dubbo:reference interface="com.foo.BarService" cache="lru" />
  2. <dubbo:reference interface="com.foo.BarService">
  3. <dubbo:method name="findBar" cache="lru" />
  4. </dubbo:reference>

泛化调用

回声测试

  1. // 远程服务引用
  2. MemberService memberService = ctx.getBean("memberService");
  3. EchoService echoService = (EchoService) memberService; // 强制转型为EchoService
  4. // 回声测试可用性
  5. String status = echoService.$echo("OK");
  6. assert(status.equals("OK"));

上下文信息

上下文中存放的是当前调用过程中所需的环境信息。所有配置信息都将转换为 URL 的参数,参见 schema 配置参考手册 中的对应URL参数一列。

RpcContext 是一个 ThreadLocal 的临时状态记录器,当接收到 RPC 请求,或发起 RPC 请求时,RpcContext 的状态都会变化。比如:A 调 B,B 再调 C,则 B 机器上,在 B 调 C 之前,RpcContext 记录的是 A 调 B 的信息,在 B 调 C 之后,RpcContext 记录的是 B 调 C 的信息。

服务消费方

  1. // 远程调用
  2. xxxService.xxx();
  3. // 本端是否为消费端,这里会返回true
  4. boolean isConsumerSide = RpcContext.getContext().isConsumerSide();
  5. // 获取最后一次调用的提供方IP地址
  6. String serverIP = RpcContext.getContext().getRemoteHost();
  7. // 获取当前服务配置信息,所有配置信息都将转换为URL的参数
  8. String application = RpcContext.getContext().getUrl().getParameter("application");
  9. // 注意:每发起RPC调用,上下文状态会变化
  10. yyyService.yyy();
服务提供方

  1. public class XxxServiceImpl implements XxxService {
  2. public void xxx() {
  3. // 本端是否为提供端,这里会返回true
  4. boolean isProviderSide = RpcContext.getContext().isProviderSide();
  5. // 获取调用方IP地址
  6. String clientIP = RpcContext.getContext().getRemoteHost();
  7. // 获取当前服务配置信息,所有配置信息都将转换为URL的参数
  8. String application = RpcContext.getContext().getUrl().getParameter("application");
  9. // 注意:每发起RPC调用,上下文状态会变化
  10. yyyService.yyy();
  11. // 此时本端变成消费端,这里会返回false
  12. boolean isProviderSide = RpcContext.getContext().isProviderSide();
  13. }
  14. }

隐式参数

可以通过 RpcContext 上的 setAttachment 和 getAttachment 在服务消费方和提供方之间进行参数的隐式传递。 1

在服务消费方端设置隐式参数
  1. // setAttachment 设置的 KV 对,在完成下面一次远程调用会被清空,即多次远程调用要多次设置。
  2. RpcContext.getContext().setAttachment("index", "1"); // 隐式传参,后面的远程调用都会隐式将这些参数发送到服务器端,类似cookie,用于框架集成,不建议常规业务使用
  3. xxxService.xxx(); // 远程调用
  4. // ...
在服务提供方端获取隐式参数`
  1. public class XxxServiceImpl implements XxxService {
  2. public void xxx() {
  3. // 获取客户端隐式传入的参数,用于框架集成,不建议常规业务使用
  4. String index = RpcContext.getContext().getAttachment("index");
  5. }
  6. }

异步调用

消费者 consumer.xml

  1. <dubbo:reference id="fooService" interface="com.alibaba.foo.FooService">
  2. <dubbo:method name="findFoo" async="true" />
  3. </dubbo:reference>
  4. <dubbo:reference id="barService" interface="com.alibaba.bar.BarService">
  5. <dubbo:method name="findBar" async="true" />
  6. </dubbo:reference>
调用代码

  1. // 此调用会立即返回null
  2. fooService.findFoo(fooId);
  3. // 拿到调用的Future引用,当结果返回后,会被通知和设置到此Future
  4. Future<Foo> fooFuture = RpcContext.getContext().getFuture();
  5. // 此调用会立即返回null
  6. barService.findBar(barId);
  7. // 拿到调用的Future引用,当结果返回后,会被通知和设置到此Future
  8. Future<Bar> barFuture = RpcContext.getContext().getFuture();
  9. // 此时findFoo和findBar的请求同时在执行,客户端不需要启动多线程来支持并行,而是借助NIO的非阻塞完成
  10. // 如果foo已返回,直接拿到返回值,否则线程wait住,等待foo返回后,线程会被notify唤醒
  11. Foo foo = fooFuture.get();
  12. // 同理等待bar返回
  13. Bar bar = barFuture.get();
  14. // 如果foo需要5秒返回,bar需要6秒返回,实际只需等6秒,即可获取到foo和bar,进行接下来的处理。
你也可以设置是否等待消息发出
  1. <!--sent="true" 等待消息发出,消息发送失败将抛出异常-->
  2. <!--sent="false" 不等待消息发出,将消息放入 IO 队列,即刻返回 -->
  3. <dubbo:method name="findFoo" async="true" sent="true" />
如果你只是想异步,完全忽略返回值,可以配置 return="false",以减少 Future 对象的创建和管理成本:
  1. <dubbo:method name="findFoo" async="true" return="false" />

事件通知

在调用之前、调用之后、出现异常时,会触发 oninvoke、onreturn、onthrow 三个事件,可以配置当事件发生时,通知哪个类的哪个方法 1。

服务提供者与消费者共享服务接口
  1. interface IDemoService {
  2. public Person get(int id);
  3. }
服务提供者实现
  1. class NormalDemoService implements IDemoService {
  2. public Person get(int id) {
  3. return new Person(id, "charles`son", 4);
  4. }
  5. }
  6. ```java
  7. ###### 服务提供者配置
  8. ```xml
  9. <dubbo:application name="rpc-callback-demo" />
  10. <dubbo:registry address="http://10.20.160.198/wiki/display/dubbo/10.20.153.186" />
  11. <bean id="demoService" class="com.alibaba.dubbo.callback.implicit.NormalDemoService" />
  12. <dubbo:service interface="com.alibaba.dubbo.callback.implicit.IDemoService" ref="demoService" version="1.0.0" group="cn"/>
服务消费者 Callback 接口
  1. interface Notify {
  2. public void onreturn(Person msg, Integer id);
  3. public void onthrow(Throwable ex, Integer id);
  4. }
服务消费者 Callback 实现

  1. class NotifyImpl implements Notify {
  2. public Map<Integer, Person> ret = new HashMap<Integer, Person>();
  3. public Map<Integer, Throwable> errors = new HashMap<Integer, Throwable>();
  4. public void onreturn(Person msg, Integer id) {
  5. System.out.println("onreturn:" + msg);
  6. ret.put(id, msg);
  7. }
  8. public void onthrow(Throwable ex, Integer id) {
  9. errors.put(id, ex);
  10. }
  11. }
服务消费者 Callback 配置
  1. <bean id ="demoCallback" class = "com.alibaba.dubbo.callback.implicit.NofifyImpl" />
  2. <dubbo:reference id="demoService" interface="com.alibaba.dubbo.callback.implicit.IDemoService" version="1.0.0" group="cn" >
  3. <dubbo:method name="get" async="true" onreturn = "demoCallback.onreturn" onthrow="demoCallback.onthrow" />
  4. </dubbo:reference>

callback 与 async 功能正交分解,async=true 表示结果是否马上返回,onreturn 表示是否需要回调。

两者叠加存在以下几种组合情况 2:

异步回调模式:async=true onreturn="xxx"

同步回调模式:async=false onreturn="xxx"

异步无回调 :async=true

同步无回调 :async=false

测试代码
  1. IDemoService demoService = (IDemoService) context.getBean("demoService");
  2. NofifyImpl notify = (NofifyImpl) context.getBean("demoCallback");
  3. int requestId = 2;
  4. Person ret = demoService.get(requestId);
  5. Assert.assertEquals(null, ret);
  6. //for Test:只是用来说明callback正常被调用,业务具体实现自行决定.
  7. for (int i = 0; i < 10; i++) {
  8. if (!notify.ret.containsKey(requestId)) {
  9. Thread.sleep(200);
  10. } else {
  11. break;
  12. }
  13. }
  14. Assert.assertEquals(requestId, notify.ret.get(requestId).getId());

并发控制

限制 com.foo.BarService 的每个方法,服务器端并发执行(或占用线程池线程数)不能超过 10 个:

  1. <dubbo:service interface="com.foo.BarService" executes="10" />

限制 com.foo.BarService 的 sayHello 方法,服务器端并发执行(或占用线程池线程数)不能超过 10 个:

  1. <dubbo:service interface="com.foo.BarService">
  2. <dubbo:method name="sayHello" executes="10" />
  3. </dubbo:service>

限制 com.foo.BarService 的每个方法,每客户端并发执行(或占用连接的请求数)不能超过 10 个:

  1. <dubbo:service interface="com.foo.BarService" actives="10" />

  1. <dubbo:reference interface="com.foo.BarService" actives="10" />

限制 com.foo.BarService 的 sayHello 方法,每客户端并发执行(或占用连接的请求数)不能超过 10 个:

  1. <dubbo:service interface="com.foo.BarService">
  2. <dubbo:method name="sayHello" actives="10" />
  3. </dubbo:service>

  1. <dubbo:reference interface="com.foo.BarService">
  2. <dubbo:method name="sayHello" actives="10" />
  3. </dubbo:service>
如果 dubbo:servicedubbo:reference 都配了actives,dubbo:reference 优先,参见:配置的覆盖策略。

令牌验证

通过令牌验证在注册中心控制权限,以决定要不要下发令牌给消费者,可以防止消费者绕过注册中心访问提供者,另外通过注册中心可灵活改变授权方式,而不需修改或升级提供者

可以全局设置开启令牌验证
  1. <!--随机token令牌,使用UUID生成-->
  2. <dubbo:provider interface="com.foo.BarService" token="true" />
  3. <!--固定token令牌,相当于密码-->
  4. <dubbo:provider interface="com.foo.BarService" token="123456" />
  5. <!--随机token令牌,使用UUID生成-->
  6. <dubbo:service interface="com.foo.BarService" token="true" />
  7. <!--固定token令牌,相当于密码-->
  8. <dubbo:service interface="com.foo.BarService" token="123456" />
  9. <!--随机token令牌,使用UUID生成-->
  10. <dubbo:protocol name="dubbo" token="true" />
  11. <!--固定token令牌,相当于密码-->
  12. <dubbo:protocol name="dubbo" token="123456" />

优雅停机

设置优雅停机超时时间 缺省超时时间是 10 秒,如果超时则强制关闭。
  1. dubbo.service.shutdown.wait=15000

日志适配

命令行

  1. java -Ddubbo.application.logger=log4j

在 dubbo.properties 中指定

  1. dubbo.application.logger=log4j

在 dubbo.xml 中配置

  1. <dubbo:application logger="log4j" />

访问日志

将访问日志输出到当前应用的log4j日志:

  1. <dubbo:protocol accesslog="true" />

将访问日志输出到指定文件:

  1. <dubbo:protocol accesslog="http://10.20.160.198/wiki/display/dubbo/foo/bar.log" />

服务容器

Spring Container
  • 自动加载 META-INF/spring 目录下的所有 Spring 配置。
  • 配置 spring 配置加载位置:
  1. dubbo.spring.config=classpath*:META-INF/spring/*.xml
Jetty Container

启动一个内嵌 Jetty,用于汇报状态。

配置:

  1. dubbo.jetty.port=8080:配置 jetty 启动端口
  2. dubbo.jetty.directory=/foo/bar:配置可通过 jetty 直接访问的目录,用于存放静态文件
  3. dubbo.jetty.page=log,status,system:配置显示的页面,缺省加载所有页面
Log4j Container

自动配置 log4j 的配置,在多进程启动时,自动给日志文件按进程分目录。

配置:

  1. dubbo.log4j.file=/foo/bar.log:配置日志文件路径
  2. dubbo.log4j.level=WARN:配置日志级别
  3. dubbo.log4j.subdirectory=20880:配置日志子目录,用于多进程启动,避免冲突
容器启动
  • java com.alibaba.dubbo.container.Main
  • java com.alibaba.dubbo.container.Main spring jetty log4j
  • java com.alibaba.dubbo.container.Main -Ddubbo.container=spring,jetty,log4j
  • dubbo.container=spring,jetty,log4j

Dubbo特性的更多相关文章

  1. dubbo+zookeeper+springBoot框架整合与dubbo泛型调用演示

    dubbo + zookeeper + spring Boot框架整合与dubbo泛型调用演示   By:客 授客 QQ:1033553122  欢迎加入全国软件测试交流 QQ  群:7156436 ...

  2. dubbo系列一、dubbo背景介绍、微服务拆分

    一.背景 随着互联网的发展,网站应用的规模不断扩大,常规的垂直应用架构已无法应对,分布式服务架构以及流动计算架构势在必行,亟需一个治理系统确保架构有条不紊的演进. 二.传统应用到分布式应用的演进过程 ...

  3. dubbo简单配置与使用

    dubbo简介 随着互联网的发展,网站应用的规模不断扩大,常规的垂直应用架构已无法应对,分布式服务架构以及流动计算架构势在必行,亟需一个治理系统确保架构有条不紊的演进. 单一应用架构 当网站流量很小时 ...

  4. dubbo学习(一)认识dubbo

    一.发展背景 单一应用架构 当网站流量很小时,只需一个应用,将所有功能都部署在一起,以减少部署节点和成本.此时,用于简化增删改查工作量的数据访问框架(ORM)是关键. 垂直应用架构 当访问量逐渐增大, ...

  5. Java 分布式框架面试题合集

    Java 分布式框架面试题合集 1.什么是 ZooKeeper? 答:ZooKeeper 是一个开源的分布式应用程序协调服务,是一个典型的分布式数据一致性解决方案.设计目的是将那些复杂且容易出错的分布 ...

  6. 2020最精细的Java学习路线图

    在吾爱破解发布的Java学习路线图自我感觉良好,之后看到动力节点Java学院的这份学习路线图感觉专业的东西还得专业的人来做,这份专业的学路线图把我上次的Java学习路线图秒成渣,虽然内容差不多,上份是 ...

  7. Dubbo有意思的特性介绍

    Duboo 不单让我们可以像使用本地服务一样的使用远程服务,还设计了很多特性来满足我们平时开发时常见的场景,省却了我们不少麻烦,真是一款有良心的框架,下面针对这些场景和解决方案来具体解释下: 1.接口 ...

  8. Dubbo高级特性实践-泛化调用

    引言 当后端Java服务用Dubbo协议作为RPC方案的基础,但部分消费方是前端Restful的PHP服务,不能直接调用,于是在中间架设了Router服务提供统一的基于HTTP的后端调用入口. 而Ro ...

  9. Dubbo 2.7新特性之异步化改造

    这是why技术的第1篇原创文章 我与Dubbo的二三事 我是2016年毕业的,在我毕业之前,我在学校里面学到的框架都是SSH,即struts+spring+hibernate,是的你没有看错,在大学里 ...

随机推荐

  1. Office 卸载问题(安装包的语言不受系统支持)

    本人系统Win7 这个问题搞了一下午.各种网站找解决办法.下载下来的都是一些垃圾软件. Win7以上调成兼容模式运行理论可行. 放上微软的解决方法: * 彻底卸载Office 2003: http:/ ...

  2. WPF几种渐变色

      [LinearGradientBrush-- 主要属性: StartPoint 获取或设置线性渐变的二维起始坐标. EndPoint 获取或设置线性渐变的二维终止坐标. 例子: <Linea ...

  3. WPF实现的简单饼图

    简介 前段时间帮一个同事的忙,利用WPF实现的一个简单饼图,仅能看饼图的比例,无文字查看功能.效果图如下: 用法: var sectorParts = new List<SectorPart&g ...

  4. 折半插入排序-ACM题

    第一种实现方式:(本人一开始对cin的使用不是很熟悉,看了一些人得博客详解后才有了第一种方式的实现,自己都被惊讶到了so easy:题目在下面) // // main.cpp // BinaryIns ...

  5. 您必须先调用“WebSecurity.InitializeDatabaseConnection”方法,然后再调用"WebSecurity"类的任何其他方法。

    今天调试程序的时候出现了这个是,可惜没截图! 您必须先调用“WebSecurity.InitializeDatabaseConnection”方法,然后再调用"WebSecurity&quo ...

  6. spss C# 二次开发 学习笔记(六)——Spss统计结果的输出

    Spss的二次开发可以很简单,实例化一个对象,然后启用服务,接着提交命令,最后停止服务. 其中重点为提交命令,针对各种统计功能需求,以及被统计分析的数据内容等,命令的内容可以很复杂,但也可以简单的为一 ...

  7. libevent学习笔记 —— 牛刀小试:简易的服务器

    回想起之前自己用纯c手动写epoll循环,libevent用起来还真是很快捷啊!重写了之前学习的时候的一个例子,分别用纯c与libevent来实现.嗯,为了方便对比一下,就一个文件写到黑了. 纯c版: ...

  8. PHP获取地址栏传的id值

    function getQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&] ...

  9. 洛谷P3763 [TJOI2017]DNA(后缀数组 RMQ)

    题意 题目链接 Sol 这题打死我也不会想到后缀数组的,应该会全程想AC自动机之类的吧 但知道这题能用后缀数组做之后应该就不是那么难了 首先把\(S\)和\(S0\)拼到一起跑,求出Height数组 ...

  10. Java设计模式—解释器模式&迭代器模式简介

       解释器模式在实际的系统开发中使用得非常少,因为它会引起效率.性能以及维护等问题,一般在大中型的框架型项目能够找到它的身影,如一些数据分析工具.报表设计工具.科学计算工具等,若你确实遇到" ...