All Projects → TFdream → Mango

TFdream / Mango

Licence: apache-2.0
A high-performance, open-source java RPC framework.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Mango

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 (+36%)
Mutual labels:  rpc, hessian, zookeeper, netty
Jupiter
Jupiter是一款性能非常不错的, 轻量级的分布式服务框架
Stars: ✭ 1,372 (+814.67%)
Mutual labels:  rpc, hessian, netty
Netty Stroll
RPC基础通信框架
Stars: ✭ 77 (-48.67%)
Mutual labels:  rpc, zookeeper, netty
twjitm-core
采用Netty信息加载实现长连接实时通讯系统,客户端可以值任何场景,支持实时http通讯、webSocket通讯、tcp协议通讯、和udp协议通讯、广播协议等 通过http协议,rpc协议。 采用自定义网络数据包结构, 实现自定义网络栈。
Stars: ✭ 98 (-34.67%)
Mutual labels:  netty, zookeeper, rpc
Easyrpc
EasyRpc is a simple, high-performance, easy-to-use RPC framework based on Netty, ZooKeeper and ProtoStuff.
Stars: ✭ 79 (-47.33%)
Mutual labels:  rpc, zookeeper, netty
Pudding
Pudding 是一款迷你级分布式服务框架
Stars: ✭ 24 (-84%)
Mutual labels:  netty, rpc, hessian
Xxl Rpc
A high performance, distributed RPC framework.(分布式服务框架XXL-RPC)
Stars: ✭ 493 (+228.67%)
Mutual labels:  rpc, hessian, netty
Rpc Fromscratch
🌈 从零开始设计一个轻量级分布式 RPC 框架,基于 Spring + Netty + Protostuff + Zookeeper
Stars: ✭ 106 (-29.33%)
Mutual labels:  rpc, zookeeper, netty
Simple Rpc
RPC with service discovery base on netty
Stars: ✭ 103 (-31.33%)
Mutual labels:  rpc, zookeeper, netty
simple-rpc-plus
使用netty和zookeeper技术实现的远程调用框架
Stars: ✭ 16 (-89.33%)
Mutual labels:  netty, zookeeper, rpc
srpc
一款轻量 高性能的RPC框架,基于netty,整合spring,支持注册中心,多种序列化,负载均衡等
Stars: ✭ 78 (-48%)
Mutual labels:  netty, zookeeper, rpc
Mrpc
🐿 netty,zookeeper,spring,kyro rpc framework.
Stars: ✭ 128 (-14.67%)
Mutual labels:  rpc, zookeeper, netty
Nettythrift
Thrift on Netty, support TCP/HTTP/WebSocket at same port. support multiple Protocols at same time. multil Simple Clients with Connection Pool.
Stars: ✭ 60 (-60%)
Mutual labels:  rpc, netty
Wheel
关于net nio os cache db rpc json web http udp tcp mq 等多个小工具的自定义实现
Stars: ✭ 45 (-70%)
Mutual labels:  rpc, netty
Nettyrpc
A simple RPC framework based on Netty, ZooKeeper and Spring
Stars: ✭ 1,975 (+1216.67%)
Mutual labels:  zookeeper, netty
Takinrpc
RPC框架,基于netty,实现了远程调用、服务治理等功能
Stars: ✭ 13 (-91.33%)
Mutual labels:  rpc, netty
Nettyrpc
NettyRPC is high performance java rpc server base on Netty,using kryo,hessian,protostuff support message serialization.
Stars: ✭ 1,131 (+654%)
Mutual labels:  rpc, netty
Springboot Templates
springboot和dubbo、netty的集成,redis mongodb的nosql模板, kafka rocketmq rabbit的MQ模板, solr solrcloud elasticsearch查询引擎
Stars: ✭ 100 (-33.33%)
Mutual labels:  zookeeper, netty
Twjitm
项目基于idea工作环境搭建的框架,添加mybatis3,spring4,springmvc4,以及redis。主要实现通过注解和反射自定义netty私有协议栈,实现在一条socket通道上传递不同的消息,采用支持tcp,udp和http协议
Stars: ✭ 26 (-82.67%)
Mutual labels:  rpc, netty
Fox
fox is a distributed RPC framework
Stars: ✭ 79 (-47.33%)
Mutual labels:  rpc, netty

Mango

License Release Version Build Status

Overview

Mango is a high-performance, open-source java RPC framework.

Features

  • Supports various serialization protocol, like protostuff, Kryo, Hessian, msgpack, Jackson, Fastjson.
  • Supports advanced features like load-balance(random, Round-Robin), HA strategy(Failfast, Failover).
  • Supports service discovery services like ZooKeeper or Consul.
  • Supports oneway, synchronous or asynchronous invoking.
  • Supports SPI extension.
  • Easy integrated with Spring Framework 4.x.

Requirements

The minimum requirements to run the quick start are:

  • JDK 1.7 or above
  • A java-based project management software like Maven or Gradle

Quick Start

1. Synchronous calls

  1. Add dependencies to pom.
    <dependency>
        <groupId>com.mindflow</groupId>
        <artifactId>mango-core</artifactId>
        <version>1.0.1</version>
    </dependency>

    <dependency>
        <groupId>com.mindflow</groupId>
        <artifactId>mango-registry-zk</artifactId>
        <version>1.0.1</version>
    </dependency>
    
    <!-- dependencies blow were only needed for spring integrated -->
    <dependency>
        <groupId>com.mindflow</groupId>
        <artifactId>mango-springsupport</artifactId>
        <version>1.0.1</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>4.3.6</version>
    </dependency>
  1. Create an interface for both service provider and consumer.
public interface DemoService {

    void hello(String msg);

    String echo(String msg);

    Map<String, String> introduce(String name, List<String> hobbies);
}
  1. Write an implementation, create and start RPC Server.
@Service("demoService")
public class DemoServiceImpl implements DemoService {

    @Override
    public void hello(String msg) {
        System.out.println(msg);
    }

    @Override
    public String echo(String msg) {
        return "hello, "+msg;
    }

    @Override
    public Map<String, String> introduce(String name, List<String> hobbies) {
        System.out.println("name:"+name + ", hobbies:"+hobbies);
        Map<String, String> map = new HashMap<>();
        map.put("name", name);
        return map;
    }

}

mango-server.xml

<?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:context="http://www.springframework.org/schema/context"
       xmlns:mango="http://code.mindflow.com/schema/mango"
       xmlns:util="http://www.springframework.org/schema/util"
       xsi:schemaLocation="
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
       http://code.mindflow.com/schema/mango http://code.mindflow.com/schema/mango/mango.xsd
       http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

    <context:annotation-config/>
    <context:component-scan base-package="mango.demo"/>

    <mango:application name="mango-server" />
    
    <mango:protocol name="mango" port="21918"/>

    <mango:registry protocol="zookeeper" address="localhost:2181"/>

    <!--export services-->
    <mango:service interface="mango.demo.service.DemoService" ref="demoService" group="group1" version="1.0.0" />
    <mango:service interface="mango.demo.service.UserService" ref="userService" version="1.0.0" />

</beans>

ServerApp.java

public class ServerApp {

    public static void main( String[] args ) {

        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:mango-server.xml");
        System.out.println("server start...");
    }
}
  1. Create and start RPC Client. mango-client.xml
<?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:context="http://www.springframework.org/schema/context"
       xmlns:util="http://www.springframework.org/schema/util"
       xmlns:mango="http://code.mindflow.com/schema/mango"
       xsi:schemaLocation="
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
       http://code.mindflow.com/schema/mango http://code.mindflow.com/schema/mango/mango.xsd
       http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

    <context:annotation-config/>
    <context:component-scan base-package="mango.demo.client"/>

    <mango:application name="mango-client" />
    
    <mango:protocol name="mango" port="21918"/>

    <mango:registry protocol="zookeeper" address="localhost:2181"/>

    <!--refer services-->
    <mango:reference id="demoService" interface="mango.demo.service.DemoService" group="group1" />
    <mango:reference id="userService" interface="mango.demo.service.UserService"/>

</beans>

ClientApp.java

public class ClientApp {

    public static void main( String[] args ) {

        ApplicationContext ctx = new ClassPathXmlApplicationContext("classpath:mango-client.xml");

        DemoService service = (DemoService) ctx.getBean("demoService");

        service.hello("rpc");
        System.out.println("echo:"+service.echo("rpc"));

        List<String> hobbies = new ArrayList<>();
        hobbies.add("NBA");
        hobbies.add("Reading");
        Map<String, String> map = service.introduce("hh", hobbies);
        System.out.println("map:"+map);
    }
}

2. Asynchronous calls

In developing.

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].