Define firstmeetgames mservice grpc api :
- hello : hello sample api
- zommon : is a share library for all above api projects
- Refer to Google API Design Guide
- Refer to Google real life example servicemanager.proto
- And local copy of Google real life example servicemanager.proto
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}If you want to trigger the build immediately, you may click the below link:
Build artifacts:
com.github.firstmeetgames.mservice-grpc-apis:uidgenerator-grpc-java:master-c0715001b4-1
com.github.firstmeetgames.mservice-grpc-apis:welfarepay-grpc-java:master-c0715001b4-1
com.github.firstmeetgames.mservice-grpc-apis:notice-grpc-java:master-c0715001b4-1
com.github.firstmeetgames.mservice-grpc-apis:usercenter-grpc-java:master-c0715001b4-1
com.github.firstmeetgames.mservice-grpc-apis:zommon-grpc-java:master-c0715001b4-1
com.github.firstmeetgames.mservice-grpc-apis:hello-grpc-java:master-c0715001b4-1
com.github.firstmeetgames.mservice-grpc-apis:mta-grpc-java:master-c0715001b4-1
If you want to trigger the build immediately, you may click the below link:
Build artifacts:
com.github.firstmeetgames.mservice-grpc-apis:uidgenerator-grpc-java:V1.0.1.RELEASE
com.github.firstmeetgames.mservice-grpc-apis:hello-grpc-java:V1.0.1.RELEASE
com.github.firstmeetgames.mservice-grpc-apis:zommon-grpc-java:V1.0.1.RELEASE
dependencies {
implementation 'com.github.firstmeetgames.mservice-grpc-apis:hello-grpc-java:master-SNAPSHOT'
implementation 'com.github.firstmeetgames.mservice-grpc-api:uidgenerator-grpc-java:master-SNAPSHOT'
implementation 'com.github.firstmeetgames.mservice-grpc-apis:zommon-grpc-java:master-SNAPSHOT'
}You can also build snapshots on each commit if you add GitHub Webhooks.
To add, head to repository Settings -> Webhooks & Services -> Add webhook.
Webhook URL: https://jitpack.io/api/webhooks
Content type: application/json
The webhook will trigger a build for branches that you have previously used with JitPack. So make sure you have requested master-SNAPSHOT from JitPack before adding a webhook.
- https://cloud.google.com/apis/design/
- Envoy and gRPC-Web: a fresh new alternative to REST
- Seamless Cloud-Native Apps with gRPC-Web and Istio
My team has been using gRPC + Improbable's grpc-web + Typescript for a green field project and it has been amazing.
-
Typing all the way to the frontend.
-
gRPC/protobuf forces you to describe your interfaces and are self-documenting.
-
gRPC semantics like error codes and deadlines (if you propagate them through your stack, they're particularly useful - for instance, we cancel database transactions across service boundaries if a request times out).
-
Performance is great (but we're far from seeing bottlenecks with JSON, it's not the reason we choose gRPC).
-
We use grpc-gateway which auto-generates a REST proxy for our customers. We sometimes use it for interactive debugging.
-
Rather than importing database models for our management tools and one-off scripts, using the API is so frictionless that we even use it inside our backend code and for CLI utilities.
The Google API design guide is helpful: https://cloud.google.com/apis/design
One piece of advice: Treat your gRPC calls like you would treat a GraphQL resolver - if you squint your eyes, they're very similar concepts.
Rather than specifying a GraphQL query, you specify a Field Mask.
https://developers.google.com/protocol-buffers/docs/referenc...
Happy to answer questions on our experience.
- This guide gets you started with gRPC-Web with a simple working example from the browser.
- https://github.com/improbable-eng/grpc-web
- https://github.com/grpc-ecosystem/grpc-gateway
- 使用gRPC-Gateway快速构建微服务
- Our Experience Designing and Building gRPC Services
- gRPC Server side load balancing with Envoy proxy
- How we built Monzo Chat on Android
- This page documents habits and styles I've found useful when working with gRPC and Protocol Buffers.