All Projects → neoremind → Navi Pbrpc

neoremind / Navi Pbrpc

Licence: apache-2.0
A protobuf based high performance rpc framework leveraging full-duplexing and asynchronous io with netty

Programming Languages

java
68154 projects - #9 most used programming language

Labels

Projects that are alternatives of or similar to Navi Pbrpc

Autocser
AutoCSer is a high-performance RPC framework. AutoCSer 是一个以高效率为目标向导的整体开发框架。主要包括 TCP 接口服务框架、TCP 函数服务框架、远程表达式链组件、前后端一体 WEB 视图框架、ORM 内存索引缓存框架、日志流内存数据库缓存组件、消息队列组件、二进制 / JSON / XML 数据序列化 等一系列无缝集成的高性能组件。
Stars: ✭ 140 (-14.11%)
Mutual labels:  rpc
Go Micro Boilerplate
The boilerplate of the GoLang application with a clear microservices architecture.
Stars: ✭ 147 (-9.82%)
Mutual labels:  rpc
Ginrpc
gin auto binding,grpc, and annotated route,gin 注解路由, grpc,自动参数绑定工具
Stars: ✭ 157 (-3.68%)
Mutual labels:  rpc
Ti Rpc
基于swoole封装的一个简易的JSON协议的RPC框架,思路是借鉴的,代码是自己写的。小修小改的,目前服务于前公司(注意是前公司)生产环境,每日支撑大约8000万次调用。
Stars: ✭ 144 (-11.66%)
Mutual labels:  rpc
Incubator Brpc
Industrial-grade RPC framework used throughout Baidu, with 1,000,000+ instances and thousands kinds of services. "brpc" means "better RPC".
Stars: ✭ 12,655 (+7663.8%)
Mutual labels:  rpc
Netty Learning Example
🥚 Netty实践学习案例,见微知著!带着你的心,跟着教程。我相信你行欧。
Stars: ✭ 2,146 (+1216.56%)
Mutual labels:  rpc
Noproto
Flexible, Fast & Compact Serialization with RPC
Stars: ✭ 138 (-15.34%)
Mutual labels:  rpc
Brpc Rs
Apache bRPC library for Rust
Stars: ✭ 159 (-2.45%)
Mutual labels:  rpc
Blog
一般不会写 API 类文章,努力写有营养的文章,喜欢请点 star
Stars: ✭ 146 (-10.43%)
Mutual labels:  rpc
Pulsar
Event driven concurrent framework for Python
Stars: ✭ 1,867 (+1045.4%)
Mutual labels:  rpc
Doge
Doge is a high-performance, Python based, open source RPC framework
Stars: ✭ 144 (-11.66%)
Mutual labels:  rpc
Co
Art of C++. Flag, logging, unit-test, json, go-style coroutine and more.
Stars: ✭ 2,264 (+1288.96%)
Mutual labels:  rpc
Mango
A high-performance, open-source java RPC framework.
Stars: ✭ 150 (-7.98%)
Mutual labels:  rpc
Jsonrpc
The jsonrpc package helps implement of JSON-RPC 2.0
Stars: ✭ 143 (-12.27%)
Mutual labels:  rpc
Gayrpc
Full Duplex C++ RPC Library,Use Protobuf, Support HTTP API .
Stars: ✭ 157 (-3.68%)
Mutual labels:  rpc
Raptor
拍拍贷微服务rpc框架
Stars: ✭ 139 (-14.72%)
Mutual labels:  rpc
Goworld
Scalable Distributed Game Server Engine with Hot Swapping in Golang
Stars: ✭ 2,007 (+1131.29%)
Mutual labels:  rpc
Hprose Php
Hprose is a cross-language RPC. This project is Hprose 3.0 for PHP
Stars: ✭ 1,952 (+1097.55%)
Mutual labels:  rpc
Netflix Clone
Netflix like full-stack application with SPA client and backend implemented in service oriented architecture
Stars: ✭ 156 (-4.29%)
Mutual labels:  rpc
Dotnettyrpc
A RPC Framework Based On DotNetty
Stars: ✭ 153 (-6.13%)
Mutual labels:  rpc

Navi-pbrpcCoverage StatusNavi-pbrpc provides a rpc solution for using protocol buffer. This library enables client and server to communicate in a peer-to-peer and full duplexing way. The server-side is built upon netty which supports asynchronous and non-blocking io functionality, while the client-side provides a wide variety of options to communicate with server, which includes short live connection, keep-alive tcp connection, high availability and failover strategy.## Quick Start### 1. PrerequisiteAdd the below dependency to pom.xml for a maven enabled project. com.baidu.beidou navi-pbrpc 1.1.1 ### 2. Make a protobuf generated messageUse protoc command to compile an IDL proto file and generate a java source file. The IDL proto file can define the request and response type. Below is a simple sample:package com.baidu.beidou.navi.pbrpc.demo.proto; option cc_generic_services = true;message DemoRequest { optional int32 user_id = 1;}message DemoResponse { optional int32 user_id = 1; optional string user_name = 2; enum GenderType { MALE = 1; FEMALE = 2; } optional GenderType gender_type = 3;}### 3. Develop server-side serviceDevelop a server-side service implementation. Below is an example based on the IDL generated java code from the previous step. Note that the method doSmth use the generated class DemoRequest as the parameter and DemoResponse as the return type. The logic here is pretty simple. public class DemoServiceImpl implements DemoService { @Override public DemoResponse doSmth(DemoRequest req) { DemoResponse.Builder builder = DemoResponse.newBuilder(); builder.setUserId(1); builder.setUserName("name-1"); builder.setGenderType(DemoResponse.GenderType.MALE); return builder.build(); } }### 4. Expose service and start serverRegister the service implementation and set the service id as 100. The id here will be used by the client later as a way of locating one specific service.Then start the server on port 8088.PbrpcServer server = new PbrpcServer(8088);server.register(100, new DemoServiceImpl());server.start();### 5. Develop client to invoke remote serviceThe framework provides many options to communicate with the server in terms of short live connection or keep-alive connection, high availablity and failover strategy. You can check out more on the Tutorials wiki.Below demostrates how to build a keep-alive, full-duplexing connection pool and make a rpc call.// 1) Build client with keep-alive, full-duplexing pooled connection, and client read timeout is 60sPbrpcClient client = PbrpcClientFactory.buildPooledConnection(new PooledConfiguration(), "127.0.0.1", 8088, 60000);// 2) Construct request data by using protobufDemoRequest.Builder req = DemoRequest.newBuilder();req.setUserId(1);byte[] data = req.build().toByteArray();// 3) Build message by specifying the service id, and the property provider is used as a client trace sign to tell server who I am.PbrpcMsg msg = new PbrpcMsg();msg.setServiceId(100);msg.setProvider("beidou");msg.setData(data);// 4) Asynchronous invocation and return a future for client to holdCallFuture<DemoResponse> future = client.asyncTransport(DemoResponse.class, msg);// 5) Wait response to come. Once rpc call is done, the code will stop blocking right away.DemoResponse res = future.get();// 6) Print out result.System.out.println(res);===### DependenciesNavi-pbrpc tries to leverage minimum amount of dependency libraries, so that project built upon Navi-pbrpc will not be overwhelmed by other unwanted libraries. The following are the dependencies. [INFO] +- commons-pool:commons-pool:jar:1.5.7:compile [INFO] +- com.google.protobuf:protobuf-java:jar:2.5.0:compile [INFO] +- io.netty:netty-all:jar:4.0.28.Final:compile [INFO] +- org.javassist:javassist:jar:3.18.1-GA:compile [INFO] +- org.slf4j:slf4j-api:jar:1.7.7:compile [INFO] +- org.slf4j:slf4j-log4j12:jar:1.7.7:compile [INFO] | - log4j:log4j:jar:1.2.17:compile===### More informationClick here to Tutorials wiki.### Supports

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