{"id":15159279,"url":"https://github.com/dinstone/jrpc","last_synced_at":"2025-07-13T23:35:57.525Z","repository":{"id":57718815,"uuid":"50276657","full_name":"dinstone/jrpc","owner":"dinstone","description":"JRPC is a lightweight Java RPC framework.","archived":false,"fork":false,"pushed_at":"2018-12-23T02:22:12.000Z","size":660,"stargazers_count":63,"open_issues_count":0,"forks_count":25,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-05T13:47:06.565Z","etag":null,"topics":["discovery","jrpc","mina","netty","service-registry","spring"],"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/dinstone.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license/ApacheV2.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-24T07:09:57.000Z","updated_at":"2025-07-02T13:09:01.000Z","dependencies_parsed_at":"2022-09-26T21:40:32.573Z","dependency_job_id":null,"html_url":"https://github.com/dinstone/jrpc","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/dinstone/jrpc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinstone%2Fjrpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinstone%2Fjrpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinstone%2Fjrpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinstone%2Fjrpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dinstone","download_url":"https://codeload.github.com/dinstone/jrpc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinstone%2Fjrpc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265222973,"owners_count":23730327,"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":["discovery","jrpc","mina","netty","service-registry","spring"],"created_at":"2024-09-26T21:02:25.238Z","updated_at":"2025-07-13T23:35:57.488Z","avatar_url":"https://github.com/dinstone.png","language":"Java","funding_links":[],"categories":["开发框架"],"sub_categories":["RPC框架"],"readme":"# What\n**JRPC** is a lightweight Java RPC framework. It enables quick and easy development of RPC applications. It greatly simplifies RPC programming.\n\n# Features\n## Design\n* Unified API for client and server\n* Support a variety of serialization protocol at the same time - Jackson and Protobuff\n* Layered architecture, including API layer, Proxy layer, Invoke layer, Protocol layer, Transport layer\n* Pluggable service discovery - registry with Zookeeper\n* The transport layer of the extensible implementation - mina, netty4, netty5\n\n## Ease of use\n* Out of the box client-side and server-side API\n* Spring integration friendly\n\n## Performance\n* Efficient custom RPC protocol\n* High-performance NIO socket frame support - mina and netty\n\n# Quick Start\nselect transport implement, add 'mina' or 'netty' dependency:\n```xml\n\u003cdependency\u003e\n\t\u003cgroupId\u003ecom.dinstone.jrpc\u003c/groupId\u003e\n\t\u003cartifactId\u003ejrpc-transport-mina\u003c/artifactId\u003e\n\t\u003cversion\u003e3.2.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\nor\n```xml\n\u003cdependency\u003e\n\t\u003cgroupId\u003ecom.dinstone.jrpc\u003c/groupId\u003e\n\t\u003cartifactId\u003ejrpc-transport-netty4\u003c/artifactId\u003e\n\t\u003cversion\u003e3.2.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\nif you need service registry and discovery, please add dependencies :\n```xml\n\u003cdependency\u003e\n\t\u003cgroupId\u003ecom.dinstone.jrpc\u003c/groupId\u003e\n\t\u003cartifactId\u003ejrpc-registry-zookeeper\u003c/artifactId\u003e\n\t\u003cversion\u003e3.2.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\nIf you are integrated with Spring, please add dependencies :\n```xml\n\u003cdependency\u003e\n\t\u003cgroupId\u003ecom.dinstone.jrpc\u003c/groupId\u003e\n\t\u003cartifactId\u003ejrpc-spring\u003c/artifactId\u003e\n\t\u003cversion\u003e3.2.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\t\n# Example\nFor more details, please refer to the example project : [jrpc-example](https://github.com/dinstone/jrpc/tree/master/jrpc-example)\n\n## java programming by API\n### export service:\n```java\n// setting endpoint config\nEndpointConfig econfig = new EndpointConfig().setEndpointName(\"example-service-provider\");\n\n// setting registry config\nRegistryConfig rconfig = new RegistryConfig().setSchema(\"zookeeper\").addProperty(\"zookeeper.node.list\",\n    \"localhost:2181\");\n\n// setting transport config\nTransportConfig tconfig = new TransportConfig().setSchema(\"mina\").addProperty(\"rpc.handler.count\", \"2\");\n\nServer server = null;\ntry {\n    ServerBuilder builder = new ServerBuilder().bind(\"localhost\", 4444);\n    // build server and start it\n    server = builder.endpointConfig(econfig).registryConfig(rconfig).transportConfig(tconfig).build();\n   server.start();\n   \n    // export service\n    server.exportService(HelloService.class, new HelloServiceImpl());\n\n    System.in.read();\n} finally {\n    if (server != null) {\n        server.stop();\n    }\n}\n```\n\n### import service:\n```java\nEndpointConfig endpointConfig = new EndpointConfig().setEndpointId(\"consumer-1\")\n    .setEndpointName(\"example-service-consumer\");\n\nRegistryConfig registryConfig = new RegistryConfig().setSchema(\"zookeeper\").addProperty(\"zookeeper.node.list\",\n    \"localhost:2181\");\n\nTransportConfig transportConfig = new TransportConfig().setSchema(\"netty\").setConnectPoolSize(2);\n\nClient client = new ClientBuilder().endpointConfig(endpointConfig).registryConfig(registryConfig)\n    .transportConfig(transportConfig).build();\n\nHelloService helloService = client.importService(HelloService.class);\nhelloService.sayHello(\"dinstone\");\n\nclient.destroy();\n```\n\n## declarative programming by Spring\n### export service:\n```xml\n\u003cbeans xmlns=\"http://www.springframework.org/schema/beans\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:jrpc=\"http://www.dinstone.com/schema/jrpc\"\n\txsi:schemaLocation=\"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd \n\thttp://www.dinstone.com/schema/jrpc http://www.dinstone.com/schema/jrpc-3.0.xsd\"\u003e\n\n\t\u003cjrpc:server\u003e\n\t\t\u003cjrpc:registry schema=\"zookeeper\"\u003e\n\t\t\t\u003cjrpc:property key=\"zookeeper.node.list\" value=\"localhost:2181\" /\u003e\n\t\t\u003c/jrpc:registry\u003e\n\t\t\u003cjrpc:transport schema=\"mina\" address=\"-:2001\" /\u003e\n\t\u003c/jrpc:server\u003e\n\t\u003cjrpc:service interface=\"com.dinstone.jrpc.example.HelloService\" implement=\"helloService\" group=\"product-v1.0\" timeout=\"2000\" /\u003e\n\n\t\u003cbean id=\"helloService\" class=\"com.dinstone.jrpc.example.HelloServiceImpl\" /\u003e\n\u003c/beans\u003e\n```\n\n### import service:\n```xml\n\u003cbeans xmlns=\"http://www.springframework.org/schema/beans\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:jrpc=\"http://www.dinstone.com/schema/jrpc\"\n\txsi:schemaLocation=\"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd \n\thttp://www.dinstone.com/schema/jrpc http://www.dinstone.com/schema/jrpc-3.0.xsd\"\u003e\n\t\n\t\u003cjrpc:client name=\"netty-client\"\u003e\n\t\t\u003cjrpc:registry schema=\"zookeeper\"\u003e\n\t\t\t\u003cjrpc:property key=\"zookeeper.node.list\" value=\"localhost:2181\" /\u003e\n\t\t\u003c/jrpc:registry\u003e\n\t\t\u003cjrpc:transport schema=\"netty\"\u003e\n\t\t\t\u003cjrpc:property key=\"rpc.serialize.type\" value=\"2\" /\u003e\n\t\t\u003c/jrpc:transport\u003e\n\t\u003c/jrpc:client\u003e\n\t\u003cjrpc:reference id=\"rhsv1\" interface=\"com.dinstone.jrpc.example.HelloService\" group=\"product-v1.0\" /\u003e\n\u003c/beans\u003e\n```\n\n# Test Result\n## JVM Parameter\n```\n-server -Xmx1g -Xms1g -Xmn712m -XX:PermSize=128m -Xss256k -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -XX:LargePageSizeInBytes=128m -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70\n```\n\n## Benchmark Test\nFor more details, please refer to the benchmark project : [jrpc-benchmark](https://github.com/dinstone/jrpc/tree/master/jrpc-benchmark)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdinstone%2Fjrpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdinstone%2Fjrpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdinstone%2Fjrpc/lists"}