{"id":28604040,"url":"https://github.com/uber/tchannel-java","last_synced_at":"2025-10-13T01:13:08.353Z","repository":{"id":53289145,"uuid":"39764417","full_name":"uber/tchannel-java","owner":"uber","description":"A Java implementation of the TChannel protocol.","archived":false,"fork":false,"pushed_at":"2023-03-19T22:47:19.000Z","size":1314,"stargazers_count":132,"open_issues_count":29,"forks_count":67,"subscribers_count":2584,"default_branch":"master","last_synced_at":"2024-05-09T07:59:09.743Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uber.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-27T08:49:33.000Z","updated_at":"2024-04-28T09:07:00.000Z","dependencies_parsed_at":"2023-02-17T13:01:43.632Z","dependency_job_id":null,"html_url":"https://github.com/uber/tchannel-java","commit_stats":null,"previous_names":[],"tags_count":74,"template":false,"template_full_name":null,"purl":"pkg:github/uber/tchannel-java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uber%2Ftchannel-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uber%2Ftchannel-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uber%2Ftchannel-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uber%2Ftchannel-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uber","download_url":"https://codeload.github.com/uber/tchannel-java/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uber%2Ftchannel-java/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259308163,"owners_count":22837974,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-11T17:40:12.335Z","updated_at":"2025-10-13T01:13:08.269Z","avatar_url":"https://github.com/uber.png","language":"Java","readme":"# TChannel for JVM\n[![Build Status](https://travis-ci.org/uber/tchannel-java.svg?branch=master)](https://travis-ci.org/uber/tchannel-java/branches)\n[![codecov.io](https://codecov.io/gh/uber/tchannel-java/branch/master/graphs/badge.svg)](https://codecov.io/gh/uber/tchannel-java/branch/master)\n[![Release](https://img.shields.io/maven-central/v/com.uber.tchannel/tchannel.svg)](https://mvnrepository.com/artifact/com.uber.tchannel)\n\nThe Java implementation of the [TChannel](https://github.com/uber/tchannel) protocol.\n\n#### Stability: *Stable*\n[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)\n\n## Example\n\n```java\n// create TChannel for server, and register a RequestHandler\nTChannel server = new TChannel.Builder(\"ping-server\").build();\nserver.makeSubChannel(\"ping-server\")\n\t.register(\"ping-handler\", new RawRequestHandler() {\n        @Override\n        public RawResponse handleImpl(RawRequest request) {\n            return new RawResponse.Builder(request)\n                .setTransportHeaders(request.getTransportHeaders())\n                .setHeader(\"Polo\")\n                .setBody(\"Pong!\")\n                .build();\n        }\n\t});\n\n// listen for incoming connections\nserver.listen();\n\n// create another TChannel for client.\nTChannel client = new TChannel.Builder(\"ping-client\").build();\nRawRequest request = new RawRequest.Builder(\"ping-server\", \"ping-handler\")\n    .setHeader(\"Marco\")\n    .setBody(\"Ping!\")\n\t.build();\n\n// make an asynchronous request\nTFuture\u003cRawResponse\u003e responseFuture = client\n\t.makeSubChannel(\"ping-server\").send(\n\t\trequest,\n\t\tserver.getHost(),\n\t\tserver.getListeningPort()\n\t);\n\n// block and wait for the response\ntry (RawResponse response = responseFuture.get()) {\n    System.out.println(response);\n}\n\n// shutdown the channel after done\nserver.shutdown();\nclient.shutdown();\n```\n\n## Overview\n\nTChannel is a network protocol with the following goals:\n\n * request / response model\n * multiple requests multiplexed across the same TCP socket\n * out of order responses\n * streaming request and responses\n * all frames checksummed\n * transport arbitrary payloads\n * easy to implement in multiple languages\n * near-redis performance\n\nThis protocol is intended to run on datacenter networks for inter-process communication.\n\n## Protocol\n\nTChannel frames have a fixed length header and 3 variable length fields. The underlying protocol\ndoes not assign meaning to these fields, but the included client/server implementation uses\nthe first field to represent a unique endpoint or function name in an RPC model.\nThe next two fields can be used for arbitrary data. Some suggested way to use the 3 fields are:\n\n* URI path, HTTP method and headers as JSON, body\n* function name, headers, thrift / protobuf\n\nNote however that the only encoding supported by TChannel is UTF-8.  If you want JSON, you'll need\nto stringify and parse outside of TChannel.\n\nThis design supports efficient routing and forwarding of data where the routing information needs\nto parse only the first or second field, but the 3rd field is forwarded without parsing.\n\n - See [protocol.md](https://github.com/uber/tchannel/blob/master/docs/protocol.md) for more details\n\n## Build\n\n```bash\nmvn clean package\n```\n\n## Run Tests\n```bash\nmvn clean test\n```\n\n\n## More Examples\n\nSee the [examples](./tchannel-example/).\n\nRun Ping server/client example:\n```bash\nmvn package\n# ping server\njava -cp tchannel-example/target/tchannel-example.jar com.uber.tchannel.ping.PingServer -p 8888\n\n# ping client\njava -cp tchannel-example/target/tchannel-example.jar com.uber.tchannel.ping.PingClient -h localhost -p 8888 -n 1000\n```\n\n## Contributing\n\nPull requests *must* have thorough testing and be reviewed by at least one other party.\nYou *must* run [benchmarks](./tchannel-benchmark/src/main/java/com/uber/tchannel/benchmarks/)\nto ensure there is no performance degradation.\n\n## Releasing\n\n1. Create an account for [oss.sonatype.org](http://oss.sonatype.org). You can sign up [here](https://issues.sonatype.org/secure/Signup!default.jspa).\n\n     This will be your credentials for ```~/.m2/settings.xml``` as well, which are going to be needed for pushing\n     changes to the Sonatype index.\n\n2. File a ticket with Sonatype to get required permissions to publish for ``com.uber.tchannel`` group ID.\n   {[example](https://issues.sonatype.org/browse/OSSRH-37519)}\n\n3. Generate and share a PGP signature.\n     \n     a. ``$ gpg --gen-key``\n     \n     b. pick ``RSA and RSA (default)`` with keysize of 2048 bits. Expiration time is left up to you\n     (but never expire might be easiest option).\n     \n     c. ``$ gpg --list-secret-keys`` will now list your keys.\n     \n     d. Take the pub key ID from the result of ``gpg --list-keys`` and do something like\n     ``$ gpg --keyserver hkp://pool.sks-keyservers.net --send-keys ********`` to upload your pub keys.\n\n4. Settings\n     \n     ``pom.xml`` already has the required configuration. Make the following change to ``~/.m2/settings.xml``, using the\n     credentials from (1).\n     \n     ```xml\n     \u003csettings\u003e\n         \u003cservers\u003e\n             \u003cserver\u003e\n                 \u003cid\u003eossrh\u003c/id\u003e\n                 \u003cusername\u003eyour-username-here\u003c/username\u003e\n                 \u003cpassword\u003eyour-password-here\u003c/password\u003e\n             \u003c/server\u003e\n         \u003c/servers\u003e\n     \u003c/settings\u003e\n     ```\n     \n     ``mvn help:effective-settings`` will assist in weeding out typos.\n\n5. Run ``make release``.\n\n6. You will be able to see activity related to the change on the Nexus Repository Manager [here](http://oss.sonatype.org). \n   It can take between 12-24 hours for the full release to complete, and the artifacts to be consumable from other projects.\n\n## MIT Licenced\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuber%2Ftchannel-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuber%2Ftchannel-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuber%2Ftchannel-java/lists"}