TChannel for the JVM [
] (https://travis-ci.org/uber/tchannel-java)
A Java implementation of the TChannel protocol.
- Frame codecs
- Message codecs
- Checksumming
- Message Multiplexing a.k.a. fragment aggregation
- Tracing
- Error Handling
- Performance
- Final API design and implementation
- Message Canceling
- Message Claiming
- Handling Errors properly
mvn clean packagemvn clean test// Create a TChannel, and register a RequestHandler
TChannel tchannel = new TChannel.Builder("ping-server")
.setServerPort(this.port)
.build();
tchannel.makeSubChannel("json-server")
.register("ping-handler", new PingRequestHandler());
// Listen for incoming connections
tchannel.listen();
// Create another TChannel to act as a client.
TChannel tchannelClient = new TChannel.Builder("ping-client").build();
JsonRequest<Ping> request = new JsonRequest.Builder<Ping>(new Ping("ping?"))
.setEndpoint("ping-handler")
.build();
// Make an asynchronous request
ListenableFuture<JsonResponse<Pong>> responseFuture = tchannel
.makeSubChannel("json-service").send(
request,
tchannel.getHost(),
tchannel.getListeningPort()
);
// Block and wait for the response
JsonResponse<Pong> response = responseFuture.get();
System.out.println(response);
response.release();mvn package
java -cp tchannel-example/target/tchannel-example.jar com.uber.tchannel.ping.PingServer -p 8888mvn package
java -cp tchannel-example/target/tchannel-example.jar com.uber.tchannel.ping.PingClient -h localhost -p 8888 -n 1000Contributions are welcome and encouraged! Please push contributions to branches namespaced by your username and then create a pull request. Pull requests must have thorough testing and be reviewed by at least one other party.