Basic Maven Project

A Maven project created from the library archetype.

License

License

GroupId

GroupId

com.colobu
ArtifactId

ArtifactId

rpcx
Last Version

Last Version

1.0
Release Date

Release Date

Type

Type

jar
Description

Description

Basic Maven Project
A Maven project created from the library archetype.
Project URL

Project URL

https://github.com/smallnest/rpcx-java
Project Organization

Project Organization

colobu
Source Code Management

Source Code Management

https://github.com/smallnest/rpcx-java

Download rpcx

How to add to project

<!-- https://jarcasting.com/artifacts/com.colobu/rpcx/ -->
<dependency>
    <groupId>com.colobu</groupId>
    <artifactId>rpcx</artifactId>
    <version>1.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.colobu/rpcx/
implementation 'com.colobu:rpcx:1.0'
// https://jarcasting.com/artifacts/com.colobu/rpcx/
implementation ("com.colobu:rpcx:1.0")
'com.colobu:rpcx:jar:1.0'
<dependency org="com.colobu" name="rpcx" rev="1.0">
  <artifact name="rpcx" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.colobu', module='rpcx', version='1.0')
)
libraryDependencies += "com.colobu" % "rpcx" % "1.0"
[com.colobu/rpcx "1.0"]

Dependencies

compile (2)

Group / Artifact Type Version
commons-io : commons-io jar 2.6
org.msgpack : msgpack-core jar 0.8.14

provided (1)

Group / Artifact Type Version
org.projectlombok : lombok jar 1.16.20

test (1)

Group / Artifact Type Version
junit : junit jar 4.11

Project Modules

There are no modules declared in this project.

rpcx-java

Unmaintained: 目前没有资源维护这个项目。欢迎有时间的开发者接手。

example

assume you have started a Go rpcx server:

package main

import (
	"context"
	"flag"

	"github.com/smallnest/rpcx/server"
)

var (
	addr = flag.String("addr", "192.168.31.82:8997", "server address")
)

type Echo int

func (t *Echo) Echo(ctx context.Context, args []byte, reply *[]byte) error {
	*reply = []byte("hello" + string(args))
	return nil
}

func main() {
	flag.Parse()

	s := server.NewServer()
	s.RegisterName("echo", new(Echo), "")
	s.Serve("tcp", *addr)
}

You can run it as:

go run main.go

Then you can write the java client:

    @Test
        public void testSendMsg() throws Exception {
            Message req = new Message("Echo", "Echo");
            req.setVersion((byte) 0);
            req.setMessageType(MessageType.Request);
            req.setHeartbeat(false);
            req.setOneway(false);
            req.setCompressType(CompressType.None);
            req.setSerializeType(SerializeType.SerializeNone);
            req.setSeq(123);
            req.metadata.put("test", "1234");
            req.payload = "world".getBytes("UTF-8");

            NettyClient client = new NettyClient(null);
            Message res = client.call("192.168.31.82:8997", req);
            System.out.println(new String(res.payload));
        }

借鉴项目

  • dubbo
  • rocketmq

feature

  • 支持和spring-boot的集成
  • 支持服务发现和注册
  • 支持扩展(client 和 server都可扩展)
  • 支持多语言调用
  • 支持qps限流
  • 支持accesslog记录
  • 支持泛化调用
  • 支持同步 异步 oneway调用
  • 支持token调用
  • 支持client端重试
  • 支持调用数据采集
  • 支持结果缓存
  • 支持热更新
  • 支持http gateway访问模式
  • 调用失败支持(FailFast Failover Failtry)
  • 支持select模式(RandomSelect RoundRobin WeightedRoundRobin SelectByUser)
  • 支持优雅关机
  • 支持服务治理(通过rpcx-ui)
  • 支持服务分组

Versions

Version
1.0