Skip to content

deific/dubbo-lite

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dubbo-lite


Dubbo 高性能升级版本,简单,高效

基于DUBBO 2.5.3构造

主要升级及改动变化

1、去除所有坑余代码及不必要的扩展
2、分为 dubbo-common 与 dubbo-rpc两大主要模块
3、NIO网络传输层升级为Apache Mina(保留dubbo原始mina版本)
4、代理生成采用 dubbo-2.5.3原生 Javassist框架
5、序列化采用高性能框架 Protostuff-1.3.3 (相比hession提升90%,秒杀java-built-in)
6、保留部分核心
7、相比dubbo原始框架,代码结构清晰,有助于阅读及参考,以及不想要过于复杂的dubbo依赖,可以考虑使用此版本
8、完美的基于注解的Spring集成能力,从此集成Spring可以少些很多代码

使用非常简单:

发布服务:
//initialize a protocol
DubboProtocol protocol = new DubboProtocol();

//export a service
protocol.export(new SimpleImpl(), Simple.class, 2880);

消费服务:
//initialize a protocol
DubboProtocol protocol = new DubboProtocol();

Simple invoker = protocol.refer(Simple.class, "127.0.0.1", 2880, 3600);

强大的与Spring基于注解的自动集成能力:

现在你会感觉Spring集成将会变的非常简单

在Spring配置文件中加入如下内容:

<dubbo:annotation-driven base-package="com"/>
系统将会自动将扫描到的Bean加入Spring容器并发布Dubbo服务,非常方便
Spring配置文件范例:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo="http://code.xyp260466.com/schema/dubbo" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://code.xyp260466.com/schema/dubbo META-INF/dubbo.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

<context:component-scan base-package="com.xyp260466.dubbo.test.provider"/>

<dubbo:annotation-driven base-package="com.xyp260466.dubbo.test.provider"/>

</beans>

消费服务:加上@Consumer注解
@Consumer
private SimpleProvider simpleProvider;

发布服务:加上@Provider注解
@Provider
public class SimpleProviderImpl implements SimpleProvider


如果你想联系作者:发送邮件(1);发送邮件(2)


blog: http://blog.csdn.net/xyp260466/article/details/51364614

About

Dubbo 高性能升级版本,简单,高效

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%