{"id":25569450,"url":"https://github.com/luxiaoxun/NettyRpc","last_synced_at":"2026-03-19T13:30:18.365Z","repository":{"id":37663945,"uuid":"53769081","full_name":"luxiaoxun/NettyRpc","owner":"luxiaoxun","description":"A simple RPC framework based on Netty, ZooKeeper and Spring","archived":false,"fork":false,"pushed_at":"2024-10-18T22:19:56.000Z","size":230,"stargazers_count":2401,"open_issues_count":7,"forks_count":1153,"subscribers_count":157,"default_branch":"master","last_synced_at":"2025-02-19T05:14:08.281Z","etag":null,"topics":["netty","rpc-framework","spring","zookeeper"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luxiaoxun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-13T05:24:45.000Z","updated_at":"2025-02-19T04:31:28.000Z","dependencies_parsed_at":"2024-11-26T15:15:11.549Z","dependency_job_id":null,"html_url":"https://github.com/luxiaoxun/NettyRpc","commit_stats":{"total_commits":90,"total_committers":11,"mean_commits":8.181818181818182,"dds":"0.43333333333333335","last_synced_commit":"1d480ede0848fc525d491020f106d706e2bd5399"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luxiaoxun%2FNettyRpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luxiaoxun%2FNettyRpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luxiaoxun%2FNettyRpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luxiaoxun%2FNettyRpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luxiaoxun","download_url":"https://codeload.github.com/luxiaoxun/NettyRpc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239933087,"owners_count":19720730,"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":["netty","rpc-framework","spring","zookeeper"],"created_at":"2025-02-21T00:02:23.746Z","updated_at":"2026-03-19T13:30:16.294Z","avatar_url":"https://github.com/luxiaoxun.png","language":"Java","funding_links":[],"categories":["开发框架","Java"],"sub_categories":[],"readme":"# NettyRpc\nAn RPC framework based on Netty, ZooKeeper and Spring  \n中文详情：[Chinese Details](http://www.cnblogs.com/luxiaoxun/p/5272384.html)\n### Features:\n* Simple code and framework\n* Service registry/discovery support by ZooKeeper\n* High availability, load balance and failover\n* Support different load balance strategy\n* Support asynchronous/synchronous call\n* Support different versions of service\n* Support different serializer/deserializer\n* Dead TCP connection detecting with heartbeat\n### Design:\n![design](https://github.com/luxiaoxun/NettyRpc/blob/master/picture/NettyRpc-design.png)\n### How to use (netty-rpc-test)\n1. Define an interface:\n    ```  \n    public interface HelloService { \n        String hello(String name); \n        String hello(Person person);\n    }\n    ```  \n2. Implement the interface with annotation @NettyRpcService:\n    ```  \n    @NettyRpcService(HelloService.class, version = \"1.0\")\n    public class HelloServiceImpl implements HelloService {\n        public HelloServiceImpl(){}\n\t\n        @Override\n        public String hello(String name) {\n            return \"Hello \" + name;\n        }\n\n        @Override\n        public String hello(Person person) {\n            return \"Hello \" + person.getFirstName() + \" \" + person.getLastName();\n        }\n    }\n    ```  \n3. Run zookeeper\n\n   For example: zookeeper is running on 127.0.0.1:2181\n\n4. Start server:\n   1. Start server with spring config: RpcServerBootstrap\n   2. Start server without spring config: RpcServerBootstrap2\n\n5. Call the service:\n    1. Use the client:\n    ```  \n   \tfinal RpcClient rpcClient = new RpcClient(\"127.0.0.1:2181\");\n   \t\t\n   \t// Sync call\n   \tHelloService helloService = rpcClient.createService(HelloService.class, \"1.0\");\n   \tString result = helloService.hello(\"World\");\n   \t\t\n   \t// Async call\n   \tRpcService client = rpcClient.createAsyncService(HelloService.class, \"2.0\");\n   \tRPCFuture helloFuture = client.call(\"hello\", \"World\");\n   \tString result = (String) helloFuture.get(3000, TimeUnit.MILLISECONDS);\n\t``` \n    2. Use annotation @RpcAutowired:\n    ``` \n    public class Baz implements Foo {\n        @RpcAutowired(version = \"1.0\")\n        private HelloService helloService1;\n           \n        @RpcAutowired(version = \"2.0\")\n        private HelloService helloService2;\n           \n        @Override\n        public String say(String s) {\n            return helloService1.hello(s);\n        }\n    }\n    ``` ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluxiaoxun%2FNettyRpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluxiaoxun%2FNettyRpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluxiaoxun%2FNettyRpc/lists"}