• Stars
    star
    7,712
  • Rank 4,671 (Top 0.1 %)
  • Language
    Go
  • License
    Other
  • Created almost 8 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Best microservices framework in Go, like alibaba Dubbo, but with more features, Scale easily. Try it. Test it. If you feel it's better, use it! ๐‰๐š๐ฏ๐šๆœ‰๐๐ฎ๐›๐›๐จ, ๐†๐จ๐ฅ๐š๐ง๐ ๆœ‰๐ซ๐ฉ๐œ๐ฑ! build for cloud!
  • stable branch: v1.7.x
  • development branch: master

Official site: http://rpcx.io

License GoDoc github actions Go Report Card coveralls QQ3็พค

Notice: etcd

since rpcx 1.7.6, some plugins have been moved to the independent project:

Announce

A tcpdump-like tool added: rpcxdumpใ€‚ You can use it to debug communications between rpcx services and clients.

Cross-Languages

you can use other programming languages besides Go to access rpcx services.

  • rpcx-gateway: You can write clients in any programming languages to call rpcx services via rpcx-gateway
  • http invoke: you can use the same http requests to access rpcx gateway
  • Java Services/Clients: You can use rpcx-java to implement/access rpcx services via raw protocol.
  • rust rpcx: You can write rpcx services in rust by rpcx-rs

If you can write Go methods, you can also write rpc services. It is so easy to write rpc applications with rpcx.

Installation

install the basic features:

go get -v github.com/smallnest/rpcx/...

If you want to use quicใ€kcp registry, use those tags to go get ใ€ go build or go run. For example, if you want to use all features, you can:

go get -v -tags "quic kcp" github.com/smallnest/rpcx/...

tags:

  • quic: support quic transport
  • kcp: support kcp transport

Which companies are using rpcx?

Features

rpcx is a RPC framework like Alibaba Dubbo and Weibo Motan.

rpcx is created for targets:

  1. Simple: easy to learn, easy to develop, easy to integrate and easy to deploy
  2. Performance: high performance (>= grpc-go)
  3. Cross-platform: support raw slice of bytes, JSON, Protobuf and MessagePack. Theoretically it can be used with java, php, python, c/c++, node.js, c# and other platforms
  4. Service discovery and service governance: support zookeeper, etcd and consul.

It contains below features

  • Support raw Go functions. There's no need to define proto files.
  • Pluggable. Features can be extended such as service discovery, tracing.
  • Support TCP, HTTP, QUIC and KCP
  • Support multiple codecs such as JSON, Protobuf, MessagePack and raw bytes.
  • Service discovery. Support peer2peer, configured peers, zookeeper, etcd, consul and mDNS.
  • Fault tolerance๏ผšFailover, Failfast, Failtry.
  • Load banlancing๏ผšsupport Random, RoundRobin, Consistent hashing, Weighted, network quality and Geography.
  • Support Compression.
  • Support passing metadata.
  • Support Authorization.
  • Support heartbeat and one-way request.
  • Other features: metrics, log, timeout, alias, circuit breaker.
  • Support bidirectional communication.
  • Support access via HTTP so you can write clients in any programming languages.
  • Support API gateway.
  • Support backup request, forking and broadcast.

rpcx uses a binary protocol and platform-independent, which means you can develop services in other languages such as Java, python, nodejs, and you can use other prorgramming languages to invoke services developed in Go.

There is a UI manager: rpcx-ui.

Performance

Test results show rpcx has better performance than other rpc framework except standard rpc lib.

The benchmark code is at rpcx-benchmark.

Listen to others, but test by yourself.

Test Environment

  • CPU: Intel(R) Xeon(R) CPU E5-2630 v3 @ 2.40GHz, 32 cores
  • Memory: 32G
  • Go: 1.9.0
  • OS: CentOS 7 / 3.10.0-229.el7.x86_64

Use

  • protobuf
  • the client and the server on the same server
  • 581 bytes payload
  • 500/2000/5000 concurrent clients
  • mock processing time: 0ms, 10ms and 30ms

Test Result

mock 0ms process time

ThroughputsMean LatencyP99 Latency

mock 10ms process time

ThroughputsMean LatencyP99 Latency

mock 30ms process time

ThroughputsMean LatencyP99 Latency

Examples

You can find all examples at rpcxio/rpcx-examples.

The below is a simple example.

Server

    // define example.Arith
    โ€ฆโ€ฆ

    s := server.NewServer()
	s.RegisterName("Arith", new(example.Arith), "")
	s.Serve("tcp", addr)

Client

    // prepare requests
    โ€ฆโ€ฆ

    d, err := client.NewPeer2PeerDiscovery("tcp@"+addr, "")
	xclient := client.NewXClient("Arith", client.Failtry, client.RandomSelect, d, client.DefaultOption)
	defer xclient.Close()
	err = xclient.Call(context.Background(), "Mul", args, reply, nil)

Contributors

Contribute

see contributors.

Welcome to contribute:

  • submit issues or requirements
  • send PRs
  • write projects to use rpcx
  • write tutorials or articles to introduce rpcx

License

Apache License, Version 2.0

More Repositories

1

go-web-framework-benchmark

โšก Go web framework benchmark
Go
1,915
star
2

1m-go-tcp-server

benchmarks for implementation of servers which support 1 million connections
Go
1,840
star
3

dive-to-gosync-workshop

ๆทฑๅ…ฅGoๅนถๅ‘็ผ–็จ‹็ ”่ฎจ่ฏพ
Go
1,604
star
4

C1000K-Servers

โšก High performance websocket servers implemented by Spray-can, Netty, undertow, jetty, Vert.x, Grizzly, node.js and Go. It supports 1,200,000 active websocket connections
Scala
1,506
star
5

gen

Converts a database into gorm structs and RESTful api
Go
1,411
star
6

concurrency-programming-via-rust

Rust
1,261
star
7

chanx

unbounded chan
Go
412
star
8

gosercomp

โšก Golang Serializer Benchmark Comparison
Go
403
star
9

ringbuffer

a thread-safe circular buffer (ring buffer) in Go, implemented io.ReaderWriter interface
Go
357
star
10

gofsm

a featured FSM that can export state images
Go
297
star
11

go-best-practices

resources for go best practices
283
star
12

douban-recommender

ๅŸบไบŽSpark MLๅฎž็Žฐ็š„่ฑ†็“ฃ็”ตๅฝฑๆŽจ่็ณป็ปŸ
Scala
224
star
13

rpcx-ui

rpcx manager web ui
Go
215
star
14

Jax-RS-Performance-Comparison

โšก Performance Comparison of Jax-RS implementations and embedded containers
Java
187
star
15

weighted

high-performance common weighted algorithm library
Go
185
star
16

ZKRecipesByExample

all examples for ZooKeeper recipes by Curator
Java
183
star
17

goframe

send/receive framed data via TCP or QUIC
Go
167
star
18

go-concurrent-quiz

Go concurrency quizzes
Go
166
star
19

kafka-example-in-scala

a kafka producer and consumer example in scala and java
Java
152
star
20

rpcx-programming-guide-cn

gitbook Go RPCๅผ€ๅ‘ๆŒ‡ๅ— [ไธญๆ–‡ๆ–‡ๆกฃ]
CSS
142
star
21

glean

hotfix for go applications via plugin, supports Linux and MacOS
Go
130
star
22

queue

lock-free queue and other implementations
Go
123
star
23

rpcx-rs

rpcx microservice framework in Rust
Rust
119
star
24

goreq

A Simplified Golang Http Client
Go
104
star
25

go_test_workshop

Go Test Workshop
HTML
100
star
26

gofer

Go
94
star
27

channels

go channel patterns
Go
89
star
28

resp3

First redis RESP3 protocol library in Go
Go
84
star
29

rpcx-java

rpcx implementation in Java for server side and client side
Java
79
star
30

smallchat

A minimal programming example for a chat server in Go and Rust
Rust
77
star
31

epoller

epoll implementation for connections in Linux, MacOS and Windows
C
75
star
32

grpc-examples

examples for gRPC
Go
63
star
33

distributed

distributed synchronization primitives
Go
60
star
34

FlyRunner

ไธ€ไธช่ฎฐๅฝ•ไฝ ๅœฐๅ›พ่ทฏ็บฟ็š„่ท‘ๆญฅ่ฝฏไปถ๏ผŒๆ— ้œ€google mapๆ”ฏๆŒ
Java
44
star
35

rpcxdump

a tcpdump-like tool to capture rpcx tcp packets
Go
43
star
36

zhuge

ๆ•‘ๅ‘ฝ็”จ็š„profile
Go
41
star
37

exp

Experimental packages not in std and golang.org/exp
Go
41
star
38

hash-bench

go hash benchmark
Go
38
star
39

mping

a multi-targets ping tool, which supports 10,000 packets/second, accurate latency
Go
38
star
40

spring-kafka-demo

Java
37
star
41

Tractor

A Tractor game. (ๅ‡็บง๏ผŒไธ€ไธชๅœจไธญๅ›ฝ้žๅธธๆต่กŒ็š„ๆ‰‘ๅ…‹็‰Œๆธธๆˆใ€‚ๅˆๅซๆ‹–ๆ‹‰ๆœบ๏ผŒๅŒๆ‰ฃ)ใ€‚ Developed by C#
C#
37
star
42

leetcode-solutions

leetcode ็ฎ—ๆณ•้ข˜่งฃ็ฒพ้€‰
37
star
43

network_benchmark

3็™พไธ‡QPS benchmarkๆต‹่ฏ•
Go
35
star
44

mahout-douban-recommender

ๅŸบไบŽmahoutๅฎž็Žฐ็š„่ฑ†็“ฃ็”ตๅฝฑๆŽจ่็ณป็ปŸ
Java
33
star
45

mping-rs

a multi-targets ping tool and library, which supports 10,000 packets/second, accurate latency
Rust
31
star
46

RPC-TEST

test performance of gRPC and Thrift. All services are implemented as HelloWorld by Java, Scala and Golang
Shell
30
star
47

breakdown

่ฎฐๅฝ•ๅ›ฝๅ†…ๅค–ไบ’่”็ฝ‘ๅ…ฌๅธๅ’Œ็”ตไฟกไผไธšP0็บงๅˆซ็š„้‡ๅคงๆ•…้šœ
27
star
48

quick

an encrypted UDP connection between two peers using QUIC
Go
26
star
49

talk-about-go-generics

่ฐˆ่ฐˆGoๆณ›ๅž‹ - GopherChina 2023 ๅคงไผšๅˆ†ไบซ
Go
24
star
50

gitalk

gitalk for colobu
19
star
51

fastjson-jaxrs-json-provider

a JAX-RS entity provider for https://github.com/alibaba/fastjson
Java
18
star
52

redis-bench

a different redis bench tool that is used for test latency at given max throughputs
Go
16
star
53

rpcxlite

a lite version of rpcx
Go
16
star
54

iprange

check whether a IP is in IP ranges with CIDR format such as 216.249.16.0/20 and 2a01:5a80::/32
Go
16
star
55

smallnest.github.io

HTML
16
star
56

leetcode

ๆœ‰็ฉบๅฐฑๅˆท้ข˜
Go
14
star
57

syncx

more advanced sync primitives in Go
Go
14
star
58

kafka_monitor

A kafka monitor to send alarm emails
Go
14
star
59

rediscopy

copy redis requests to other servers
Go
14
star
60

weighted-rs

A Rust library for weighted balancing algorithm
Rust
12
star
61

gomemcached

memcached protocol implementation for memcached server
Go
12
star
62

rpcx-agent

Agent to invoke rpcx services in C++, Java, Python, C#, Ruby, etc. for rpcx 2.x
Go
10
star
63

gofu

functional go with generic types
10
star
64

libra-wallet

a libra wallet example in go
HTML
9
star
65

qianmo

additional network functions
Go
9
star
66

rust-examples

study rust by examples
Rust
9
star
67

rpcx-programming-guide-en

rpcx programming guide (english version)
9
star
68

Ember-Lance

Dashboard Bootstrap implemented with sb-admin2, Ember, D3.js and other third-party libraries
JavaScript
9
star
69

concurrency-programming-via-go-code

code of concurrency programming via go
Go
9
star
70

DisruptorBootstrap

Example for Disruptor and Spring Reactor
Java
8
star
71

nettrace

explore internal/nettrace in go std lib
Go
8
star
72

go-app-metrics

add system monitor (cpu/load/memory/disk/bandwidth) to go-metrics
Go
7
star
73

blockchain

a general blockchain implementation
Go
7
star
74

go-cheatsheets

7
star
75

go-generics-examples

go generics examples
Assembly
7
star
76

pool

a go pool that you don't worry about GC
Go
5
star
77

libp2p

a secure go p2p libary, easy to use. cloned from go-spacemesh
Go
5
star
78

libkv-etcdv3-store

libkv etcd store by client v3 API: https://github.com/docker/libkv
Go
5
star
79

preallocate

File preallocation library, cloned from https://git.sr.ht/~tslocum/preallocate
Go
5
star
80

benchpi

rust examples for calculating PI
Rust
4
star
81

json-parser-benchmark

json parser benchmark
Go
4
star
82

Java-Memcached-Clients-Benchmark

โšก Benchmark for Java Memcached clients such as SpyMemcached, XMemcached and folsom
Scala
4
star
83

p2p

p2p examples
Go
4
star
84

word

ไธ€ไธชๅ‘ฝไปค่กŒไธญๆŸฅๆ‰พ่‹ฑ่ฏญๅ•่ฏ็š„ๆ„ๆ€ๅ’Œๅ‘้Ÿณ
Go
4
star
85

tracert

a special traceroute lib for multiple paths by UDP
Go
4
star
86

kafka-go-examples

examples for kafka go clients
Go
3
star
87

golang-tls

golang tls for http/http2 examples
Go
3
star
88

awesome-web-templates

record free web templates
3
star
89

concurrency-programming-via-go

Goๅนถๅ‘็ผ–็จ‹ๅ‹˜่ฏฏ้กตๅ’Œ้—ฎ้ข˜ๅ้ฆˆ
2
star
90

Scala-Collections-Cookbook

codes for the book "Scala Collections Cookbook"
Scala
2
star
91

libra-wallet-rust

libra wallet in rust
CSS
2
star
92

batch

batch process or timeout
Go
2
star
93

bitcoin

bitcoin study
Go
2
star
94

shorturl

a scalable high performance ShortURL server
Scala
2
star
95

go-database-study

study golang database lib
Go
2
star
96

ai_assistant

็†ŠๅŽ‚ๅ†…ๅˆ†ไบซ๏ผŒgithub copilot vs baidu comate
Go
1
star
97

traceto

traceroute with Geographic information
Go
1
star
98

SpringMongoExample

Java
1
star
99

jsonrpc-demo

implemented in Go, call from C via CGO
C
1
star
100

f

Go functional lib with Generic
1
star