pink.catty:catty-test

RPC framework

License

License

GroupId

GroupId

pink.catty
ArtifactId

ArtifactId

catty-test
Last Version

Last Version

0.2.6
Release Date

Release Date

Type

Type

jar
Description

Description

RPC framework

Download catty-test

How to add to project

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

Dependencies

compile (6)

Group / Artifact Type Version
pink.catty : catty-all jar 0.2.6
pink.catty : catty-spring jar 0.2.6
org.springframework : spring-context jar 5.0.8.RELEASE
com.google.protobuf : protobuf-java jar 3.8.0
org.apache.logging.log4j : log4j-slf4j-impl jar 2.11.2
org.apache.logging.log4j : log4j-core jar 2.11.2

test (1)

Group / Artifact Type Version
junit : junit jar 4.5

Project Modules

There are no modules declared in this project.

Build Status Maven Central License

Catty

Whole new RPC framework!

Features

  • High performance.
  • Async & reactor oriented.
  • Micro-kernel & Easy to customize
  • ProtoBuf supported.

Project Status

Catty has released a few versions, which means you could use Catty in your own project!

But as the version is senior than 1.0.0, which means catty is not stable and has not adequately tested yet, I temporarily do not recommend you to use it in any large distribution system. But I do recommend you to use it in a smaller system or point-to-point system, in which cases Catty would be more easier to use and control.

Usage

See example package or test package.

Maven:

<dependency>
    <groupId>pink.catty</groupId>
    <artifactId>catty-all</artifactId>
    <version>0.2.6</version>
</dependency>

build:

mvn clean install -DskipTests -Dmaven.javadoc.skip=true -Dgpg.skip

test:

mvn clean test

Sync:

Server:

ServerConfig serverConfig = ServerConfig.builder()
    .port(20550)
    .build();
ProtocolConfig protocolConfig = ProtocolConfig.defaultConfig();

Exporter exporter = new Exporter(serverConfig);
exporter.setProtocolConfig(protocolConfig);
exporter.registerService(IService.class, new IServiceImpl());
exporter.export();

Client:

ClientConfig clientConfig = ClientConfig.builder()
    .addAddress("127.0.0.1:20550")
    .build();
ProtocolConfig protocolConfig = ProtocolConfig.defaultConfig();

Reference<IService> reference = new Reference<>();
reference.setClientConfig(clientConfig);
reference.setProtocolConfig(protocolConfig);
reference.setInterfaceClass(IService.class);

IService service = reference.refer();
System.out.println(service.say0());
System.out.println(service.say1("catty"));

Async:

Server:

ServerConfig serverConfig = ServerConfig.builder()
    .port(20550)
    .build();
ProtocolConfig protocolConfig = ProtocolConfig.defaultConfig();
Exporter exporter = new Exporter(serverConfig);
exporter.setProtocolConfig(protocolConfig);
exporter.registerService(IService.class, new IServiceImpl());
exporter.export();

Client:

ClientConfig clientConfig = ClientConfig.builder()
    .addAddress("127.0.0.1:20550")
    .build();
ProtocolConfig protocolConfig = ProtocolConfig.defaultConfig();

Reference<IService> reference = new Reference<>();
reference.setClientConfig(clientConfig);
reference.setProtocolConfig(protocolConfig);
reference.setInterfaceClass(IService.class);

IService service = reference.refer();
CompletableFuture<String> future = service.asyncSay("catty");
future.whenComplete((value, t) -> System.out.println(value));

Welcome to join me!

There are lots of things need todo:

  • doc
  • benchmark
  • test
  • more useful extensions
  • log & annotation
  • code review & refactor

Versions

Version
0.2.6
0.2.5
0.2.4
0.2.3
0.2.2
0.2.1
0.2.0
0.1.7
0.1.6
0.1.5
0.1.4
0.1.3
0.1.2
0.1.0