GithubHelp home page GithubHelp logo

deific / dubbo-lite Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rucky2013/dubbo-lite

0.0 1.0 0.0 152 KB

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

Home Page: https://github.com/xyp260466/dubbo-lite

License: Apache License 2.0

Java 100.00%

dubbo-lite's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.