{"id":21656840,"url":"https://github.com/anmiralles/springboot-grpc-unary-example","last_synced_at":"2026-04-15T18:02:21.429Z","repository":{"id":264587221,"uuid":"888885030","full_name":"anmiralles/springboot-grpc-unary-example","owner":"anmiralles","description":"Couple of spring boot microservices communicating through unary gRPC.","archived":false,"fork":false,"pushed_at":"2024-11-27T10:52:29.000Z","size":203,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-20T05:17:43.819Z","etag":null,"topics":["flyway","grpc","postgresql","reactive","spring-boot","unary"],"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/anmiralles.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":"2024-11-15T07:35:58.000Z","updated_at":"2024-11-27T10:52:33.000Z","dependencies_parsed_at":"2024-11-25T08:18:37.085Z","dependency_job_id":"125b24c4-2234-464f-9cb2-a653b2608ddd","html_url":"https://github.com/anmiralles/springboot-grpc-unary-example","commit_stats":null,"previous_names":["anmiralles/springboot-grpc-unary-example"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/anmiralles/springboot-grpc-unary-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anmiralles%2Fspringboot-grpc-unary-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anmiralles%2Fspringboot-grpc-unary-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anmiralles%2Fspringboot-grpc-unary-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anmiralles%2Fspringboot-grpc-unary-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anmiralles","download_url":"https://codeload.github.com/anmiralles/springboot-grpc-unary-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anmiralles%2Fspringboot-grpc-unary-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31853279,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["flyway","grpc","postgresql","reactive","spring-boot","unary"],"created_at":"2024-11-25T09:17:46.395Z","updated_at":"2026-04-15T18:02:21.408Z","avatar_url":"https://github.com/anmiralles.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spring-Boot gRPC Example\n\n## Introduction\nThis is a sample application demonstrating spring-boot using gRPC protocol between 2 microservices. There are several\nways of gRPC intercommunication, in this case we will use unary gRPC.\n\n## Architecture\nThe architecture diagram of this solution is the following:\n\n![Architecture](images/architecture.png)\n\n## gRPC Intercommunication\nThe intercommunication process is based on the diagram:\n\n![Communication](images/communication.png)\n\nSteps:\n1. micro1 offers a REST endpoint to initiate the communication.\n2. micro1 sends gRPC request to micro2 asking for entity and id.\n3. micro2 sends gRPC response accepting the communication, just ACK.\n4. micro2 generates an event and using observer pattern initiates async response.\n5. micro2 sends gRPC request to micro1 attaching entity and id data.\n6. micro1 sends gRPC response to micro1, ACK the whole communication.\n\n### Exposed Endpoints\nThe following table lists the available REST and gRPC endpoints. The [OpenAPI document](openapi-schema.yml) for the REST endpoints is also available.\n\n| Path           | HTTP method | Response Status | Response Object | Description                                                 |\n|----------------|-------------|-----------------|-----------------|-------------------------------------------------------------|\n| `/entity/{id}` | `GET`       | `200`           | ACK             | Initial communication asking for an entity to be delivered. |\n\ngRPC endpoints are exposed using protobuf, served components are linked here:\n\n[`Category`](springboot-grpc-client/src/main/proto/category.proto)\n[`Entity`](springboot-grpc-client/src/main/proto/entity.proto)\n\n\n## Running Locally using Podman\n\nIn order to run it locally we need to run a postgresql container through the command:\n\n``` shell script\npodman run -d --name db-server --net test -e POSTGRES_USER=test -e POSTGRES_PASSWORD=test -e POSTGRES_DB=category -p 5432:5432 postgres:16\n```\n\nOnce the postgresql container is running we can start the application by running:\n\n``` shell script\n./mvnw clean package spring-boot:run\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanmiralles%2Fspringboot-grpc-unary-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanmiralles%2Fspringboot-grpc-unary-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanmiralles%2Fspringboot-grpc-unary-example/lists"}