返回排行榜

luxiaoxun/NettyRpc

Java

A simple RPC framework based on Netty, ZooKeeper and Spring

nettyrpc-frameworkspringzookeeper
Star 增长趋势
Star
2.4k
Forks
1.1k
周增长
Issues
6
1k2k
2016年3月2019年8月2023年2月2026年7月
制品库Mavengit clone https://github.com/luxiaoxun/NettyRpc.git
README

NettyRpc

An RPC framework based on Netty, ZooKeeper and Spring
中文详情:Chinese Details

Features:

  • Simple code and framework
  • Service registry/discovery support by ZooKeeper
  • High availability, load balance and failover
  • Support different load balance strategy
  • Support asynchronous/synchronous call
  • Support different versions of service
  • Support different serializer/deserializer
  • Dead TCP connection detecting with heartbeat

Design:

design

How to use (netty-rpc-test)

  1. Define an interface:

    public interface HelloService { 
        String hello(String name); 
        String hello(Person person);
    }
    
  2. Implement the interface with annotation @NettyRpcService:

    @NettyRpcService(HelloService.class, version = "1.0")
    public class HelloServiceImpl implements HelloService {
        public HelloServiceImpl(){}
    
        @Override
        public String hello(String name) {
            return "Hello " + name;
        }
    
        @Override
        public String hello(Person person) {
            return "Hello " + person.getFirstName() + " " + person.getLastName();
        }
    }
    
  3. Run zookeeper

    For example: zookeeper is running on 127.0.0.1:2181

  4. Start server:

    1. Start server with spring config: RpcServerBootstrap
    2. Start server without spring config: RpcServerBootstrap2
  5. Call the service:

    1. Use the client:
       final RpcClient rpcClient = new RpcClient("127.0.0.1:2181");
           
       // Sync call
       HelloService helloService = rpcClient.createService(HelloService.class, "1.0");
       String result = helloService.hello("World");
           
       // Async call
       RpcService client = rpcClient.createAsyncService(HelloService.class, "2.0");
       RPCFuture helloFuture = client.call("hello", "World");
       String result = (String) helloFuture.get(3000, TimeUnit.MILLISECONDS);
    
    1. Use annotation @RpcAutowired:
    public class Baz implements Foo {
        @RpcAutowired(version = "1.0")
        private HelloService helloService1;
           
        @RpcAutowired(version = "2.0")
        private HelloService helloService2;
           
        @Override
        public String say(String s) {
            return helloService1.hello(s);
        }
    }
    
相关仓库
crossoverJie/JCSprout

👨‍🎓 Java Core Sprout : basic, concurrent, algorithm

JavaMavenMIT Licensejavaconcurrent-programming
crossoverjie.top/JCSprout
26.9k7k
doocs/source-code-hunter

😱 从源码层面,剖析挖掘互联网行业主流技术的底层实现原理,为广大开发者 “提升技术深度” 提供便利。目前开放 Spring 全家桶,Mybatis、Netty、Dubbo 框架,及 Redis、Tomcat 中间件等

JavaMavenCreative Commons Attribution Share Alike 4.0 Internationalsourcecode-analysisspring
schunter.doocs.org
23.1k4.2k
eclipse-vertx/vert.x

Vert.x is a tool-kit for building reactive applications on the JVM

JavaMavenOthervertxjava
vertx.io
14.7k2.1k
crossoverJie/cim

📲cim(cross IM) 适用于开发者的分布式即时通讯系统

JavaMavenMIT Licensenettytcp
crossoverjie.top/categories/Netty/
9.5k2.9k
mrniko/netty-socketio

Socket.IO server implemented on Java. Realtime java framework

JavaMavenApache License 2.0socket-iojava
7k1.7k
gatling/gatling

Modern Load Testing as Code

ScalaApache License 2.0nettyscala
gatling.io
6.9k1.2k
jetlinks/jetlinks-community

JetLinks 基于Java,Spring Boot ,WebFlux,Netty,Vert.x,Reactor等开发, 是一个全响应式的企业级物联网平台。支持统一物模型管理,多种设备,多种厂家,统一管理。统一设备连接管理,多协议适配(TCP,MQTT,UDP,CoAP,HTTP等),屏蔽网络编程复杂性,灵活接入不同厂家不同协议等设备。实时数据处理,设备告警,消息通知,数据转发。地理位置,数据可视化等。能帮助你快速建立物联网相关业务系统。

JavaMavenApache License 2.0iotjava
jetlinks.cn
6.5k1.9k
AsyncHttpClient/async-http-client

Asynchronous, non-blocking HTTP & WebSocket client for the JVM

JavaMavenApache License 2.0nettyasync
6.4k1.6k
JackJiang2011/MobileIMSDK

原创全平台IM通信层框架,轻量级、高度提炼,历经10年、久经考验。可能是市面上唯一同时支持UDP+TCP+WebSocket三种协议的同类开源框架,支持 iOS、Android、Java、H5、小程序、Uniapp、鸿蒙Next,服务端基于Netty。

Objective-CApache License 2.0imudp
52im.net/forum-89-1.html
6.1k1.4k
line/armeria

Your go-to microservice framework for any situation, from the creator of Netty et al. You can build any type of microservice leveraging your favorite technologies, including gRPC, Thrift, Kotlin, Retrofit, Reactive Streams, Spring Boot and Dropwizard.

JavaMavenApache License 2.0httphttp2
armeria.dev
5.1k1k
helidon-io/helidon

Java libraries for writing microservices

JavaMavenApache License 2.0javamicroservice-framework
helidon.io
3.8k605
mpusher/mpush

MPush开源实时消息推送系统

JavaMavenApache License 2.0pushnetty
mpusher.github.io
3.8k1.4k