{"id":49815461,"url":"https://github.com/dawnbreaks/NettyRPC","last_synced_at":"2026-05-29T21:00:50.031Z","repository":{"id":14090348,"uuid":"16794268","full_name":"dawnbreaks/NettyRPC","owner":"dawnbreaks","description":"Yet another RPC framework based on Netty","archived":false,"fork":false,"pushed_at":"2017-04-18T00:55:01.000Z","size":3904,"stargazers_count":122,"open_issues_count":3,"forks_count":74,"subscribers_count":32,"default_branch":"master","last_synced_at":"2026-03-15T02:37:14.303Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dawnbreaks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-13T06:38:44.000Z","updated_at":"2026-02-13T12:49:21.000Z","dependencies_parsed_at":"2022-09-23T19:00:14.949Z","dependency_job_id":null,"html_url":"https://github.com/dawnbreaks/NettyRPC","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/dawnbreaks/NettyRPC","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dawnbreaks%2FNettyRPC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dawnbreaks%2FNettyRPC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dawnbreaks%2FNettyRPC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dawnbreaks%2FNettyRPC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dawnbreaks","download_url":"https://codeload.github.com/dawnbreaks/NettyRPC/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dawnbreaks%2FNettyRPC/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33670211,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2026-05-13T06:00:43.974Z","updated_at":"2026-05-29T21:00:50.024Z","avatar_url":"https://github.com/dawnbreaks.png","language":"Java","funding_links":[],"categories":["开发框架"],"sub_categories":["RPC框架"],"readme":"[![Build Status](https://travis-ci.org/dawnbreaks/NettyRPC.png?branch=master)](https://travis-ci.org/dawnbreaks/NettyRPC)\r\nNettyRPC\r\n========\r\n\r\nYet another RPC framework based on [Netty](https://github.com/netty/netty).\r\n\r\n\r\nFeatures\r\n========\r\n\r\n  * Simple, small code base, easy to learn API\r\n  * Very fast, high performance\r\n  * Totally non-blocking asynchronous call, synchronous call, oneway call.\r\n  * Long lived persistent connection, reconnect to server automatically\r\n  * High availability, load balance and failover \r\n  * Multi thread server and multi thread client\r\n  * Thread safe client, for an remote service you only need to create a singleton client. \r\n  * Service Discovery support, use zookeeper as a service registry. \r\n  * PHP client (Unimplemented yet)  \r\n  \r\nSimple tutorial\r\n========\r\n####1.Define an obj interface\r\n```java\r\npublic interface IHelloWordObj {\r\n\tString hello(String msg);\r\n\tString test(Integer i, String s, Long l);\r\n\tvoid notifySomeThing(Integer i, String s, Long l);\r\n}\r\n```\r\n  \r\n####2.Implements the previous defined interface\r\n```java\r\npublic class HelloWorldObj implements IHelloWordObj {\r\n\t@Override\r\n\tpublic String hello(String msg) {\r\n\t\treturn msg;\r\n\t}\r\n\t@Override\r\n\tpublic String test(Integer i, String s, Long l) {\r\n\t\treturn i+s+l;\r\n\t}\r\n\t@Override\r\n\tvoid notifySomeThing(Integer i, String s, Long l) {\r\n\t\tSystem.out.println(\"notifySomeThing|i=\"+i+\"|s=\"+s+\"l=\"+l);\r\n\t}\r\n}\r\n```\r\n\r\n####3. Update configuration file and start the server \"com.lubin.rpc.server.RPCServer\"\r\n```javascript\r\nserver {\r\n\tport = 9090\r\n\tbacklog = 1000\r\n\tasync = false\t//handling request in business logic thread pool\r\n\tasyncThreadPoolSize = 4\r\n    ioThreadNum = 4\r\n    enableServiceDiscovery = true   \r\n\tobjects = [\r\n\t\tcom.lubin.rpc.example.obj.HelloWorldObj\r\n\t]\r\n}\r\nclient {\r\n\tsyncCallTimeOutMillis = 300\r\n\tconnectTimeoutMillis = 300\r\n\treconnIntervalMillis = 1000\t//time interval for reconnecting to server\r\n\tasyncThreadPoolSize = 1   //thread pool for excuting Async callback\r\n    ioThreadNum = 1   \r\n    objects = [ \r\n\t\t{ \r\n\t\t\tname = com.lubin.rpc.example.obj.IHelloWordObj\r\n\t\t\tservers =\"127.0.0.1:9090 127.0.0.1:9091\"\r\n\t\t}\r\n\t]\r\n}\r\n```\r\n\r\n\r\n####4.Synchronous call. Create an Obj proxy and call the remote Obj.\r\n```java\r\n    IHelloWordObj client = RPCClient.proxyBuilder(IHelloWordObj.class)\r\n    \t\t\t\t\t            .withServerNode(\"127.0.0.1\", 9090)\r\n    \t\t\t\t\t            .build();\r\n    String result = client.hello(\"hello world!\");\r\n```\r\n\r\n####5. Asynchronous call\r\n#####5.1.\r\n```java\r\n    IAsyncObjectProxy asyncClient = RPCClient.proxyBuilder(IHelloWordObj.class)\r\n    \t\t\t\t\t                     .withServerNode\r\n    \t\t\t\t\t\t                 .buildAsyncObjPrx();\r\n    \r\n    RPCFuture helloFuture = asyncClient.call(\"hello\", \"hello world!\");\r\n    RPCFuture testFuture = asyncClient.call(\"test\", 1,\"hello world!\",2L);\r\n    Object res1= helloFuture.get(3000, TimeUnit.MILLISECONDS);\r\n    Object res2= testFuture.get(3000, TimeUnit.MILLISECONDS);\r\n\r\n```\r\n#####5.2. Optionally you can provide a callback which will be automatically called by NettyRPC after received response from server.\r\n```java\r\npublic class AsyncHelloWorldCallback implements AsyncRPCCallback {\r\n\t@Override\r\n\tpublic void fail(Exception e) {\r\n\t\tSystem.out.println(e.getMessage());\r\n\t}\r\n\t@Override\r\n\tpublic void success(Object result) {\r\n\t\tSystem.out.println(result);\r\n\t}\r\n}\r\n\r\n    IAsyncObjectProxy asyncClient = RPCClient.proxyBuilder(IHelloWordObj.class)\r\n    \t\t\t\t\t\t                 .withServerNode(\"127.0.0.1\", 9090)\r\n    \t\t\t\t\t   \t                 .buildAsyncObjPrx();\r\n    RPCFuture helloFuture = asyncClient.call(\"hello\", \"hello world!\")\r\n    \t\t\t\t\t\t           .addCallback(new AsyncHelloWorldCallback());\r\n    RPCFuture testFuture = asyncClient.call(\"test\", 1,\"hello world!\",2L)\r\n    \t\t\t\t\t\t           .addCallback(new AsyncHelloWorldCallback());\r\n```\r\n\r\n####6.Oneway call\r\n```java\r\n    IAsyncObjectProxy asyncClient = RPCClient.proxyBuilder(IHelloWordObj.class)\r\n    \t\t\t\t\t\t                 .withServerNode(\"127.0.0.1\", 9090)\r\n    \t\t\t\t\t\t                 .buildAsyncObjPrx();\r\n    asyncClient.notify(\"notifySomeThing\", 1, \"hello world!\", 2L);\r\n```\r\n\r\n####7 High availability, you can deploy more than one servers to achieve HA, NettyRPC handle load balance and failover automatically.  \r\n```java\r\n    ArrayList\u003cInetSocketAddress\u003e serverNodeList = new ArrayList\u003cInetSocketAddress\u003e();\r\n    serverNodeList.add(new InetSocketAddress(\"127.0.0.1\",9090));\r\n    serverNodeList.add(new InetSocketAddress(\"127.0.0.1\",9091));\r\n         \r\n    IHelloWordObj client = RPCClient.proxyBuilder(IHelloWordObj.class)\r\n    \t\t\t\t\t            .withServerNodes(serverNodeList)\r\n    \t\t\t\t\t            .build();\r\n    System.out.println(\"test server list:\"+client.hello(\"test server list11\"));\r\n```\r\n\r\n####8 Service Discovery support\r\nInstead of hard coding the server address in config file( or java source code), NettyRPC support service discovery. \r\nAll Services will automatically register themself to registry(Zookeeper) after services started,  and NettyRPC client will automatically query addresses from the registry.\r\nIf you want to scale out and deploy more server, you just simply start the new services, NettyRPC client will automatically got notified and dispatch requests to that new services.\r\n\r\n```java\r\n    IHelloWordObj client = RPCClient.proxyBuilder(IHelloWordObj.class)\r\n    \t\t\t\t\t            .enableRegistry()\r\n    \t\t\t\t\t            .build();\r\n    System.out.println(\"test server list:\"+client.hello(\"test server list11\"));\r\n```\r\n========\r\nPlease feel free to contact me(2005dawnbreaks@gmail.com) if you have any questions.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdawnbreaks%2FNettyRPC","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdawnbreaks%2FNettyRPC","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdawnbreaks%2FNettyRPC/lists"}