{"id":25413793,"url":"https://github.com/inomera/pims-grpc","last_synced_at":"2025-06-15T00:34:30.957Z","repository":{"id":277428931,"uuid":"931707821","full_name":"inomera/pims-grpc","owner":"inomera","description":"multi module spring boot grpc example project","archived":false,"fork":false,"pushed_at":"2025-04-10T20:25:32.000Z","size":155,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-22T15:49:27.468Z","etag":null,"topics":["grpc-java","java","jdk23","protobuf-java","protobuf3","springboot3"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/inomera.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2025-02-12T18:14:22.000Z","updated_at":"2025-04-10T20:25:36.000Z","dependencies_parsed_at":"2025-04-22T14:39:00.143Z","dependency_job_id":"ab86a0b7-3a13-46ec-9e27-54027965a2ce","html_url":"https://github.com/inomera/pims-grpc","commit_stats":null,"previous_names":["inomera/pims-grpc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/inomera/pims-grpc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inomera%2Fpims-grpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inomera%2Fpims-grpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inomera%2Fpims-grpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inomera%2Fpims-grpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inomera","download_url":"https://codeload.github.com/inomera/pims-grpc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inomera%2Fpims-grpc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259905418,"owners_count":22929916,"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":["grpc-java","java","jdk23","protobuf-java","protobuf3","springboot3"],"created_at":"2025-02-16T14:31:45.767Z","updated_at":"2025-06-15T00:34:30.916Z","avatar_url":"https://github.com/inomera.png","language":"Java","readme":"# Spring Boot GRPC Project Example\n\n### **Multi-Module Spring Boot and gRPC Example Project**\n\n#### **Project Overview**\nThis project serves as a practical implementation of **gRPC within a Spring Boot multi-module architecture**, enabling efficient, high-performance service-to-service communication. It provides a structured approach to building scalable microservices, leveraging **gRPC** for **low-latency, high-throughput** interactions while maintaining **compatibility with traditional REST clients**.\n\n#### **Architecture \u0026 Communication Patterns**\n- **Client Interaction:**\n  - A RESTful API, exposed via **HTTP 1.1**, is served through a **Tomcat web server**.\n  - The client communicates via standard REST endpoints, interacting with the underlying gRPC-based services.\n\n- **Inter-Module Communication:**\n  - Modules interact with each other via **gRPC**, supporting both:\n    - **Synchronous communication** for real-time request-response interactions.\n    - **Asynchronous communication** using gRPC streaming for event-driven processing.\n\n#### **Key Features \u0026 Enhancements**\n- **Spring Boot Integration:**\n  - Seamlessly integrates **gRPC server and client** with the Spring Boot application context.\n  - Uses **Spring Boot’s dependency injection (DI) and configuration management** for gRPC services.\n\n- **Governance \u0026 Observability:**\n  - **Logging:** Comprehensive gRPC request/response logging for debugging and monitoring.\n  - **Header Enrichment:** Metadata propagation to enhance service traceability.\n  - **Security:** Implementing authentication/authorization strategies such as JWT, mTLS, and API keys.\n\n- **Scalability \u0026 Performance Optimizations:**\n  - **Load balancing**: Configuring client-side or service-side load balancing for high availability.\n  - **Connection pooling**: Efficient management of gRPC channels to optimize resource usage.\n  - **Resilience mechanisms**: Implementing timeouts, retries, and circuit breakers to handle failures gracefully.\n\n#### **Benefits \u0026 Use Cases**\n✅ **Low-latency, high-performance communication** between microservices.  \n✅ **Efficient resource utilization** with persistent connections.  \n✅ **Hybrid integration**: Supports both gRPC-based service-to-service calls and RESTful clients.  \n✅ **Enhanced security and governance** for production-grade deployments.  \n✅ **Scalable and modular design** for large-scale microservices architectures.\n\n🚀 This project provides a **solid foundation for building microservices** using **Spring Boot and gRPC**, combining **modern communication patterns with enterprise-grade best practices**.\n\n### Flows\n\n![Sync flow](files/flows/sync.png)\n\n![Async flow](files/flows/async.png)\n\n\n### Testing\n\nMacOS\n\n```shell\nbrew install grpcurl\n```\n\n#### GRPC URL\n```curl\ngrpcurl -v -d '{\"smsHeader\": \"1234\", \"msgTxt\":\"Hello pims\" , \"receiverMsisdn\" : \"905557502861\", \"txKey\" : \"TX-1\" }' \\n\n-plaintext localhost:9090 com.inomera.pims.sal.MessagingService/sendCustomerAcknowledgeMsg\n```\n\n#### REST API\n\nAsync\n\n```curl\ncurl --location 'http://localhost:8080/ws/rest/external/v10/messages/send/async' \n--header 'Content-Type: application/json' \\\n--data '{\n    \"smsHeader\": \"1234\",\n    \"msgTxt\": \"Hello pims\",\n    \"receiverMsisdn\": \"905557502861\",\n    \"txKey\": \"TX-1\"\n}'\n```\n\nSync\n\n```curl\ncurl --location 'http://localhost:8080/ws/rest/external/v10/messages/send/process' \n--header 'Content-Type: application/json' \\\n--data '{\n    \"smsHeader\": \"1234\",\n    \"msgTxt\": \"Hello pims\",\n    \"receiverMsisdn\": \"905557502861\",\n    \"txKey\": \"TX-1\"\n}'\n```\n\n### Load Test with Siege \n\nMacOS\n\n```shell\nbrew install siege\n```\n\nyou can find siege files under files directory.\n\nconcurrent 5 users, no delay, 30 seconds\n\n```bash\n#!/bin/bash\n\nsiege -d0 -c5 -t30S \\\n-H 'Content-Type: application/json' \\\n'http://localhost:8080/ws/rest/external/v10/messages/send/process POST { \"header\": \"7070\",\"msisdn\": \"905077505015\",\"text\": \"Hoş geldin process GRPC\"}' \\\n-H 'Accept:application/json' \n```\n\nOutput\n\n```shell\nLifting the server siege...\nTransactions:\t\t       10211 hits\nAvailability:\t\t      100.00 %\nElapsed time:\t\t       31.03 secs\nData transferred:\t        0.47 MB\nResponse time:\t\t        0.00 secs\nTransaction rate:\t      329.07 trans/sec\nThroughput:\t\t        0.02 MB/sec\nConcurrency:\t\t        0.63\nSuccessful transactions:       10211\nFailed transactions:\t           0\nLongest transaction:\t        6.72\nShortest transaction:\t        0.00\n```\n\n### Tech Stack\n\n* Spring Boot 3.4.2\n* Spring GRPC Boot 0.4.0-SHAPSHOT\n* GRPC 1.7.0\n* Apache Tomcat 10+\n* Protobuf\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finomera%2Fpims-grpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finomera%2Fpims-grpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finomera%2Fpims-grpc/lists"}