{"id":19154100,"url":"https://github.com/quan-nh/clj-grpc","last_synced_at":"2026-04-30T12:32:59.378Z","repository":{"id":137253625,"uuid":"473893373","full_name":"quan-nh/clj-grpc","owner":"quan-nh","description":null,"archived":false,"fork":false,"pushed_at":"2022-05-14T14:45:24.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-22T21:26:19.507Z","etag":null,"topics":["clojure","grpc","protobuf"],"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/quan-nh.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":"2022-03-25T06:25:12.000Z","updated_at":"2022-03-25T06:47:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"dddc5980-2ea7-4534-bcc5-5c23b9dfa828","html_url":"https://github.com/quan-nh/clj-grpc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/quan-nh/clj-grpc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quan-nh%2Fclj-grpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quan-nh%2Fclj-grpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quan-nh%2Fclj-grpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quan-nh%2Fclj-grpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/quan-nh","download_url":"https://codeload.github.com/quan-nh/clj-grpc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quan-nh%2Fclj-grpc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32465009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"online","status_checked_at":"2026-04-30T02:00:05.929Z","response_time":57,"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":["clojure","grpc","protobuf"],"created_at":"2024-11-09T08:25:25.631Z","updated_at":"2026-04-30T12:32:59.358Z","avatar_url":"https://github.com/quan-nh.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# clj-grpc\n\nClojure gRPC\n\n## Guide\n\n- Create Clojure app\n```sh\nlein new app clj-grpc\n```\n\n- Update `project.clj` to separate java \u0026 clojure source:\n```clj\n  :source-paths [\"src/clj\"]\n  :java-source-paths [\"src/java\"]\n```\n\n- Add sample proto file [src/proto/helloworld.proto](src/proto/helloworld.proto)\n\n- Generating the code using Protocol Buffer Compiler\n  - Download latest protoc from https://github.com/protocolbuffers/protobuf/releases\n  - Obtain the [gRPC Java Codegen Plugin](https://github.com/grpc/grpc-java/tree/master/compiler)\n  - `protoc --plugin=protoc-gen-grpc-java=$PATH_TO_PLUGIN -I=$SRC_DIR\n    --java_out=$DST_DIR --grpc-java_out=$DST_DIR $SRC_DIR/helloworld.proto`\n\n- Using lein plugin\n  - https://github.com/bsima/lein-protoc\n    ```clj\n    :plugins [[lein-protoc \"0.4.0\"]]\n    ; lein-protoc config\n    :proto-version ~proto-version\n    :protoc-grpc {:version ~grpc-version}\n    :proto-source-paths [\"src/proto\"] ; default\n    :proto-target-path \"src/java\"\n    ```\n  - `lein protoc`\n\n- Add grpc deps\n```clj\n;; ref https://github.com/grpc/grpc-java\n[io.grpc/grpc-netty-shaded ~grpc-version]\n[io.grpc/grpc-protobuf ~grpc-version]\n[io.grpc/grpc-stub ~grpc-version]\n[org.apache.tomcat/annotations-api \"6.0.53\"] ; necessary for Java 9+\n```\n\n- Creating the server\n  - impl service\n  ```clj\n  (defn greeter-service []\n    (proxy [GreeterGrpc$GreeterImplBase] []\n      (sayHello [^HelloRequest request response]\n        (let [name (.getName request)\n              builder (-\u003e (HelloReply/newBuilder)\n                          (.setMessage (str \"Hello \" name)))]\n          (.onNext response (.build builder))\n          (.onCompleted response)))))\n  ```\n  - start server\n  ```clj\n  (let [server (-\u003e (ServerBuilder/forPort 9090)\n                   (.addService (greeter-service))\n                   (.build))]\n    (.start server)\n    (println \"Server started, listening on 9090\")\n    (.awaitTermination server))\n  ```\n  \n- Creating the client\n```clj\n(let [channel (-\u003e (ManagedChannelBuilder/forAddress \"localhost\" 9090)\n                    (.usePlaintext)\n                    (.build))\n        stub (GreeterGrpc/newBlockingStub channel)\n        req (-\u003e (HelloRequest/newBuilder)\n                (.setName \"test\")\n                (.build))\n        resp (.sayHello stub req)]\n    (prn resp)\n    (.shutdown channel))\n```\n\n- AppsFlyer/pronto\n+ https://github.com/AppsFlyer/pronto/\n+ https://medium.com/appsflyerengineering/appsflyers-open-source-libraries-for-clojure-and-protocol-buffers-da9a87583c41\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquan-nh%2Fclj-grpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquan-nh%2Fclj-grpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquan-nh%2Fclj-grpc/lists"}