All Projects → Yohann-Codes → Pudding

Yohann-Codes / Pudding

Licence: other
Pudding 是一款迷你级分布式服务框架

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Pudding

Jupiter
Jupiter是一款性能非常不错的, 轻量级的分布式服务框架
Stars: ✭ 1,372 (+5616.67%)
Mutual labels:  netty, rpc, rpc-framework, hessian
Xxl Rpc
A high performance, distributed RPC framework.(分布式服务框架XXL-RPC)
Stars: ✭ 493 (+1954.17%)
Mutual labels:  netty, rpc, hessian
Thunder
⚡️ Nepxion Thunder is a distribution RPC framework based on Netty + Hessian + Kafka + ActiveMQ + Tibco + Zookeeper + Redis + Spring Web MVC + Spring Boot + Docker 多协议、多组件、多序列化的分布式RPC调用框架
Stars: ✭ 204 (+750%)
Mutual labels:  netty, rpc, hessian
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.
Stars: ✭ 3,392 (+14033.33%)
Mutual labels:  netty, rpc, rpc-framework
Getty
a netty like asynchronous network I/O library based on tcp/udp/websocket; a bidirectional RPC framework based on JSON/Protobuf; a microservice framework based on zookeeper/etcd
Stars: ✭ 532 (+2116.67%)
Mutual labels:  netty, rpc, rpc-framework
Easyrpc
EasyRpc is a simple, high-performance, easy-to-use RPC framework based on Netty, ZooKeeper and ProtoStuff.
Stars: ✭ 79 (+229.17%)
Mutual labels:  netty, rpc, rpc-framework
Mango
A high-performance, open-source java RPC framework.
Stars: ✭ 150 (+525%)
Mutual labels:  netty, rpc, hessian
small-rpc
🔥基于netty和hessian的一个轻量级RPC调用框架
Stars: ✭ 21 (-12.5%)
Mutual labels:  netty, hessian
hrpc
Common interface definition based rpc implementation
Stars: ✭ 21 (-12.5%)
Mutual labels:  rpc, rpc-framework
litchi
这是一款分布式的java游戏服务器框架
Stars: ✭ 97 (+304.17%)
Mutual labels:  netty, rpc
nerve-rpc
Nim RPC framework
Stars: ✭ 32 (+33.33%)
Mutual labels:  rpc, rpc-framework
jigsaw-rpc
jigsaw-rpc is an RPC framework written in TypeScript under Node.js
Stars: ✭ 14 (-41.67%)
Mutual labels:  rpc, rpc-framework
libcorpc
Libcorpc is a high performance coroutine base RPC framework
Stars: ✭ 20 (-16.67%)
Mutual labels:  rpc, rpc-framework
eagle
Eagle分布式rpc调用,借助Zookeeper实现服务注册和发现,基于AQS实现高性能连接池,支持分布式追踪、监控、过载保护等配置。提供Spring和SpringBoot插件,方便与Spring和SpringBoot集成。
Stars: ✭ 77 (+220.83%)
Mutual labels:  netty, kryo
Spring Dubbo Service
微服务 spring dubbo项目:dubbo rpc;druid数据源连接池;mybatis配置集成,多数据源;jmx监控MBean;定时任务;aop;ftp;测试;Metrics监控;参数验证;跨域处理;shiro权限控制;consul服务注册,发现;redis分布式锁;SPI服务机制;cat监控;netty服务代理;websocket;disconf;mongodb集成;rest;docker;fescar
Stars: ✭ 224 (+833.33%)
Mutual labels:  netty, rpc
netty-learning
bio, nio到 netty各种使用案例, 包含基础使用案例,各api使用方法,零拷贝,websocket,群聊,私聊,编码,解码,自定义协议,protobuf等使用案例,rpc服务器,客户端等等学习
Stars: ✭ 49 (+104.17%)
Mutual labels:  netty, rpc
Mini Rpc
Spring + Netty + Protostuff + ZooKeeper 实现了一个轻量级 RPC 框架,使用 Spring 提供依赖注入与参数配置,使用 Netty 实现 NIO 方式的数据传输,使用 Protostuff 实现对象序列化,使用 ZooKeeper 实现服务注册与发现。使用该框架,可将服务部署到分布式环境中的任意节点上,客户端通过远程接口来调用服务端的具体实现,让服务端与客户端的开发完全分离,为实现大规模分布式应用提供了基础支持
Stars: ✭ 205 (+754.17%)
Mutual labels:  netty, rpc-framework
nodejs grpc
GRPC based API CRUD using Nodejs at both server and client side
Stars: ✭ 17 (-29.17%)
Mutual labels:  rpc, rpc-framework
simpleRPC
Simple RPC implementation for Arduino.
Stars: ✭ 28 (+16.67%)
Mutual labels:  rpc, rpc-framework
mini-rpc
Spring + Netty + Protostuff + ZooKeeper 实现了一个轻量级 RPC 框架,使用 Spring 提供依赖注入与参数配置,使用 Netty 实现 NIO 方式的数据传输,使用 Protostuff 实现对象序列化,使用 ZooKeeper 实现服务注册与发现。使用该框架,可将服务部署到分布式环境中的任意节点上,客户端通过远程接口来调用服务端的具体实现,让服务端与客户端的开发完全分离,为实现大规模分布式应用提供了基础支持
Stars: ✭ 221 (+820.83%)
Mutual labels:  netty, rpc-framework

Pudding 一款迷你级分布式服务框架

  • 注册中心支持集群模式
  • 服务自动发现
  • 同步/异步调用
  • 负载均衡
  • 限流

使用示例

1. 启动注册中心 (集群)

public class RegistryServer_1 {
    public static void main(String[] args) throws InterruptedException {
        // 启动注册中心
        PuddingServiceRegistry registry = new DefaultServiceRegistry();
        registry.startRegistry(20001);

        // 等待其它注册服务器启动完成(时间尽量长些)
        Thread.sleep(15000);

        // 接入注册中心集群
        registry.joinUpCluster("127.0.0.1:20002", "127.0.0.1:20003", "127.0.0.1:20004");
    }
}
public class RegistryServer_2 {
    public static void main(String[] args) {
        // 启动注册中心
        PuddingServiceRegistry registry = new DefaultServiceRegistry();
        registry.startRegistry(20002);

        // 接入注册中心集群
        registry.joinUpCluster( "127.0.0.1:20003", "127.0.0.1:20004", "127.0.0.1:20001");
    }
}
public class RegistryServer_3 {
    public static void main(String[] args) {
        // 启动注册中心
        PuddingServiceRegistry registry = new DefaultServiceRegistry();
        registry.startRegistry(20003);

        // 接入注册中心集群
        registry.joinUpCluster( "127.0.0.1:20004", "127.0.0.1:20001", "127.0.0.1:20002");
    }
}
public class RegistryServer_4 {
    public static void main(String[] args) {
        // 启动注册中心
        PuddingServiceRegistry registry = new DefaultServiceRegistry();
        registry.startRegistry(20004);

        // 接入注册中心集群
        registry.joinUpCluster("127.0.0.1:20001", "127.0.0.1:20002", "127.0.0.1:20003");
    }
}

2. 启动服务提供者

public class ProviderServer_1 {
    public static void main(String[] args) {
        // 创建提供者并连接注册中心
        ServiceProvider provider = new DefaultServiceProvider();
        provider.connectRegistry("127.0.0.1:20001", "127.0.0.1:20002", "127.0.0.1:20003", "127.0.0.1:20004");

        // 创建需要发布服务的元数据
        ServiceA serviceA = new ServiceAImpl();
        ServiceB serviceB = new ServiceBImpl();

        // 发布服务(权重范围0~10)
        ServiceMeta serviceMetaA = DefaultMetaFactory.createPublishMeta(serviceA, "127.0.0.1:30001", 5);
        ServiceMeta serviceMetaB = DefaultMetaFactory.createPublishMeta(serviceB, "127.0.0.1:30002", 5);

        // 启动服务
        provider.startServices(serviceMetaA, serviceMetaB);

        // 发布已启动的全部服务
        provider.publishAllService();
    }
}
public class ProviderServer_2 {
    public static void main(String[] args) {
        // 创建提供者并连接注册中心
        ServiceProvider provider = new DefaultServiceProvider();
        provider.connectRegistry("127.0.0.1:20001", "127.0.0.1:20002", "127.0.0.1:20003", "127.0.0.1:20004");

        // 创建需要发布服务的元数据
        ServiceC serviceC = new ServiceCImpl();
        ServiceD serviceD = new ServiceDImpl();

        // 发布服务(权重范围0~10)
        ServiceMeta serviceMetaC = DefaultMetaFactory.createPublishMeta(serviceC, "127.0.0.1:30003", 5);
        ServiceMeta serviceMetaD = DefaultMetaFactory.createPublishMeta(serviceD, "127.0.0.1:30004", 5);

        // 启动服务
        provider.startServices(serviceMetaC, serviceMetaD);

        // 发布已启动的全部服务
        provider.publishAllService();
    }
}

3. 启动服务消费者

public class ConsumerServer_1 {
    public static void main(String[] args) {
        // 创建消费者并连接注册中心
        ServiceConsumer consumer = new DefaultServiceConsumer();
        consumer.connectRegistry("127.0.0.1:20001", "127.0.0.1:20002", "127.0.0.1:20003", "127.0.0.1:20004");

        // 创建需要订阅服务的元数据
        ServiceMeta serviceMetaA = DefaultMetaFactory.createSubscribeMeta(ServiceA.class.getName());
        ServiceMeta serviceMetaB = DefaultMetaFactory.createSubscribeMeta(ServiceB.class.getName());

        // 订阅服务(同步方式,订阅成功后返回)
        consumer.subscribeServices(serviceMetaA, serviceMetaB);

        // 创建同步调用代理服务
        ServiceA serviceA = ServiceProxyFactory.createSyncProxy(ServiceA.class);
        ServiceB serviceB = ServiceProxyFactory.createSyncProxy(ServiceB.class);

        // 同步调用(监听器参数传null即可)
        try {
            int add = serviceA.add(100, 200, null);
            System.out.println("100 + 200 = " + add);
            int subtract = serviceB.subtract(200, 100, null);
            System.out.println("200 - 100 = " + subtract);
        } catch (InvokeTimeoutException e) {
            System.out.println("调用超时");
        } catch (NotFindServiceException e) {
            System.out.println("未找到服务");
        } catch (ServiceBusyException e) {
            System.out.println("服务繁忙");
        }
    }
}
public class ConsumerServer_2 {
    public static void main(String[] args) {
        // 创建消费者并连接注册中心
        ServiceConsumer consumer = new DefaultServiceConsumer();
        consumer.connectRegistry("127.0.0.1:20001", "127.0.0.1:20002", "127.0.0.1:20003", "127.0.0.1:20004");

        // 创建需要订阅服务的元数据
        ServiceMeta serviceMetaC = DefaultMetaFactory.createSubscribeMeta(ServiceC.class.getName());
        ServiceMeta serviceMetaD = DefaultMetaFactory.createSubscribeMeta(ServiceD.class.getName());

        // 订阅服务(同步方式,订阅成功后返回)
        consumer.subscribeServices(serviceMetaC, serviceMetaD);

        // 创建异步调用代理服务
        ServiceC serviceC = ServiceProxyFactory.createAsyncProxy(ServiceC.class);
        ServiceD serviceD = ServiceProxyFactory.createAsyncProxy(ServiceD.class);

        // 异步调用
        serviceC.multiply(100, 200, new InvokerFutureListener<Integer>() {
            @Override
            public void success(Integer result) {
                System.out.println("100 * 200 = " + result);
            }

            @Override
            public void failure(Exception e) {
                e.printStackTrace();
            }
        });

        serviceD.divide(200, 100, new InvokerFutureListener<Integer>() {
            @Override
            public void success(Integer result) {
                System.out.println("200 / 100 = " + result);
            }

            @Override
            public void failure(Exception e) {
                e.printStackTrace();
            }
        });
    }
}
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].