All Projects → dempeZheng → Forest

dempeZheng / Forest

Licence: other
基于netty轻量的高性能分布式RPC服务框架

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Forest

Highdsa
2018年本科毕设项目,已更新所有开发和部署文档。基于Dubbo、SSM、Shiro、ELK、ActiveMQ、Redis等实现的一套高可用、高性能、高可扩展的分布式系统架构,实现可支持业务的基础公共服务,API使用Restful风格对外暴露。已经实现的包括:发送邮件服务、FastDFS文件存储服务、ELK实时日志查询服务、Redis缓存服务、Mybatis数据库、阿里短信推送、Goeasy消息推送、Druid监控、ActiveMQ消息队列、shiro权限认证、cas单点登录、权限配置web系统、移动端后台系统。持续更新中......
Stars: ✭ 385 (-8.33%)
Mutual labels:  dubbo, spring
Source Code Hunter
😱 从源码层面,剖析挖掘互联网行业主流技术的底层实现原理,为广大开发者 “提升技术深度” 提供便利。目前开放 Spring 全家桶,Mybatis、Netty、Dubbo 框架,及 Redis、Tomcat 中间件等
Stars: ✭ 7,392 (+1660%)
Mutual labels:  dubbo, spring
Raincat
强一致分布式事务框架
Stars: ✭ 1,785 (+325%)
Mutual labels:  dubbo, spring
Ibase4j
Spring,SpringBoot 2.0,SpringMVC,Mybatis,mybatis-plus,motan/dubbo分布式,Redis缓存,Shiro权限管理,Spring-Session单点登录,Quartz分布式集群调度,Restful服务,QQ/微信登录,App token登录,微信/支付宝支付;日期转换、数据类型转换、序列化、汉字转拼音、身份证号码验证、数字转人民币、发送短信、发送邮件、加密解密、图片处理、excel导入导出、FTP/SFTP/fastDFS上传下载、二维码、XML读写、高精度计算、系统配置工具类等等。
Stars: ✭ 1,548 (+268.57%)
Mutual labels:  dubbo, spring
Zheng
基于Spring+SpringMVC+Mybatis分布式敏捷开发系统架构,提供整套公共微服务服务模块:集中权限管理(单点登录)、内容管理、支付中心、用户管理(支持第三方登录)、微信平台、存储系统、配置中心、日志分析、任务和通知等,支持服务治理、监控和追踪,努力为中小型企业打造全方位J2EE企业级开发解决方案。
Stars: ✭ 16,163 (+3748.33%)
Mutual labels:  dubbo, spring
Ssm Demo
🍌Spring+SpringMVC+Mybatis+easyUI实现简单的后台管理系统
Stars: ✭ 1,639 (+290.24%)
Mutual labels:  dubbo, spring
Priest
dubbo mybatis springboot base soa rest api framework with customer code generator
Stars: ✭ 160 (-61.9%)
Mutual labels:  dubbo, spring
Rsf
已作为 Hasor 的子项目,迁移到:http://git.oschina.net/zycgit/hasor
Stars: ✭ 77 (-81.67%)
Mutual labels:  dubbo, spring
Bus
Bus 是一个基础框架、服务套件,它基于Java8编写,参考、借鉴了大量已有框架、组件的设计,可以作为后端服务的开发基础中间件。代码简洁,架构清晰,非常适合学习使用。
Stars: ✭ 253 (-39.76%)
Mutual labels:  dubbo, spring
Joice
Java分布式开发平台:Spring, Spring MVC, MyBatis, Dubbo, Redis, Shiro权限管理, Quartz分布式调度, RocketMQ通信, 本地缓存, Redis缓存, 分布式缓存, 分布式事务
Stars: ✭ 219 (-47.86%)
Mutual labels:  dubbo, spring
Myth
Reliable messages resolve distributed transactions
Stars: ✭ 1,470 (+250%)
Mutual labels:  dubbo, spring
Ibase4j Springboot
Spring,SpringBoot,SpringMVC,Mybatis,mybatis-plus,motan/dubbo分布式,Redis缓存,Shiro权限管理,Spring-Session单点登录,Quartz分布式集群调度,Restful服务,QQ/微信登录,App token登录,微信/支付宝支付;日期转换、数据类型转换、序列化、汉字转拼音、身份证号码验证、数字转人民币、发送短信、发送邮件、加密解密、图片处理、excel导入导出、FTP/SFTP/fastDFS上传下载、二维码、XML读写、高精度计算、系统配置工具类等等。
Stars: ✭ 348 (-17.14%)
Mutual labels:  dubbo, spring
Superman
Superman是什么:构建Java 高级开发技术的知识体系,从基础不断打怪升级成为超人之路(更新中.......)
Stars: ✭ 106 (-74.76%)
Mutual labels:  dubbo, spring
Skill6 Website Backend
java进阶开发,高级版web项目。基于dubbo实现分布式微服务架构,基于spring boot、spring mvc、mybatis、docker、ELK、redis、vue.js、node.js等技术实现的技术分享交流网站。网站名称:技术流,英文名:skill6。主要功能有:登录注册、单点登录、restful设计、文章及评论、代码及资源下载、主题讨论等。持续更新中...
Stars: ✭ 140 (-66.67%)
Mutual labels:  dubbo, spring
Whatsmars
Java生态研究(Spring Boot + Redis + Dubbo + RocketMQ + Elasticsearch)🔥🔥🔥🔥🔥
Stars: ✭ 1,389 (+230.71%)
Mutual labels:  dubbo, spring
Technology Talk
汇总java生态圈常用技术框架、开源中间件,系统架构、数据库、大公司架构案例、常用三方类库、项目管理、线上问题排查、个人成长、思考等知识
Stars: ✭ 12,136 (+2789.52%)
Mutual labels:  dubbo, spring
Javaall
这是一个Java开发宝典,所有的Java技术都在这里,用心学习,努力提升!
Stars: ✭ 67 (-84.05%)
Mutual labels:  dubbo, spring
Javacore
Java程序员所需要掌握的核心知识: 集合框架&JVM机制&多线程与并发框架&网络协议&Spring&Dubbo&MySQL&微服务等;希望胖友小手一抖,右上角来个 Star,感恩 1024
Stars: ✭ 73 (-82.62%)
Mutual labels:  dubbo, spring
Blog
每周一篇,内容精简,不咸不淡,期盼探讨。微信公众号:芋道源码【纯源码分享公众号】
Stars: ✭ 2,327 (+454.05%)
Mutual labels:  dubbo, spring
Spring Cloud Alibaba
Spring Cloud Alibaba provides a one-stop solution for application development for the distributed solutions of Alibaba middleware.
Stars: ✭ 20,934 (+4884.29%)
Mutual labels:  dubbo, spring

Forest

License Build Status

Overview

基于netty轻量的高性能分布式RPC服务框架。简单,易用,高效。

Features

  • 服务端支持多种序列化方式:fastjson,hession,kryo
  • 服务端支持多种压缩方式:gzip,snappy
  • 服务端支持同时基于jersey暴露restful服务
  • 支持注解配置,也支持spring xml配置
  • 支持服务发现服务注册
  • client端支持多种负载均衡策略和容灾策略
  • client内置连接池
  • client支持熔断,一个时间段错误次数达到一定阈值,自动熔断
  • 基于netty 4.x版本实现,高性能(win 8cpu单机8w+)

Protocol

Alt text

Quick Start

Add dependencies to pom.

<dependency>
    <groupId>com.zhizus</groupId>
    <artifactId>forest-rpc</artifactId>
    <version>0.0.2</version>
</dependency>

<dependency>
    <groupId>com.zhizus</groupId>
    <artifactId>forest-common</artifactId>
    <version>0.0.2</version>
</dependency>

1.定义接口

通过注解@ServiceProvider暴露服务,通过@MethodProvider暴露方法默认配置,如:压缩方式,序列化方式,客户端超时时间

@ServiceProvider(serviceName = "sampleService", haStrategyType = HaStrategyType.FAIL_FAST,
        loadBalanceType = LoadBalanceType.RANDOM, connectionTimeout = Constants.CONNECTION_TIMEOUT)
public interface SampleService {

    @MethodProvider(methodName = "say")
    String say(String str);

    @MethodProvider(methodName = "echo", serializeType = SerializeType.Hession2, compressType = CompressType.None)
    String echo(String msg);
}

2.实现接口

基于注解@ServiceExport发布服务,基于注解 @MethodExport发布方法,

@Path("/sample")
@ServiceExport
public class SampleServiceImpl implements SampleService {

    /**
     * 支持jersey,可以通过配置打开,同时启动http服务
     *
     * @param str
     * @return
     */
    @Path("/hello/{str}")
    @GET
    @Produces("text/plain")
    @MethodExport
    @Rate(2)
    @Override
    public String say(@PathParam("str") String str) {
        return "say " + str;
    }

    @Interceptor("metricInterceptor")
    @MethodExport
    @Override
    public String echo(String msg) {
        return "echo>>> " + msg;
    }

}

3.服务端开发

spring context 配置:

application.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns="http://www.springframework.org/schema/beans" xmlns:forest="http://api.zhizus.com/schema/forest"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context.xsd
        http://api.zhizus.com/schema/forest http://api.zhizus.com/schema/forest.xsd">

    <context:component-scan base-package="com.zhizus.forest.demo"/>

    <context:property-placeholder location="classpath:/*.properties"/>


    <forest:registry id="registry" regProtocol="local"  name="registry" address="127.0.0.1:2181"/>
    <!--<forest:registry id="registry" regProtocol="zookeeper" name="registry" address="127.0.0.1:2181"/>-->

    <forest:server id="forestServer" registry="registry" startHttpServer="true"/>

    <forest:interceptors>
        <forest:interceptor id="metricInterceptor" class="com.zhizus.forest.support.MetricInterceptor" auto-match="public *(*)"/>
    </forest:interceptors>


</beans>

Server开发

public class SampleServer {
    public static void main(String[] args) throws Exception {
	new ClassPathXmlApplicationContext(new String[]{"application.xml"});
    }
}

4.客户端开发

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns="http://www.springframework.org/schema/beans"
       xmlns:aop="http://www.springframework.org/schema/aop" xmlns:forest="http://api.zhizus.com/schema/forest"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context.xsd   http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd http://api.zhizus.com/schema/forest http://api.zhizus.com/schema/forest.xsd">

    <context:component-scan base-package="com.zhizus.forest.demo.client"/>

    <forest:registry id="registry" regProtocol="local" name="registry" address="127.0.0.1:9999"/>

    <forest:referer id="sampleService" interface="com.zhizus.forest.demo.api.SampleService" registry="registry">
        <forest:method name="echo" timeout="5000" serializeType="Fastjson"/>
        <forest:method name="say" timeout="5000" serializeType="Fastjson" compressType="GZIP"/>
    </forest:referer>


</beans>
ApplicationContext context = new ClassPathXmlApplicationContext(new String[]{"application-client.xml"});
     SampleService bean = (SampleService) context.getBean("sampleService");
     String test = bean.say("hello");

Console输出

23:10:10.295 [pool-1-thread-1] INFO MetricInterceptor 34 - methodName:/sampleService/say, current tps:83342, avgTime:0, maxTime:63, minTime:0
23:10:11.298 [pool-1-thread-1] INFO MetricInterceptor 34 - methodName:/sampleService/say, current tps:86271, avgTime:0, maxTime:63, minTime:0
23:10:12.295 [pool-1-thread-1] INFO MetricInterceptor 34 - methodName:/sampleService/say, current tps:86063, avgTime:0, maxTime:63, minTime:0
23:10:13.295 [pool-1-thread-1] INFO MetricInterceptor 34 - methodName:/sampleService/say, current tps:84305, avgTime:0, maxTime:63, minTime:0

更多示例

Documents

TODO

  • 跨语言协议支持
  • 服务治理管理后台

License

Forest is released under the Apache License 2.0.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].