Skip to content

firstmeetgames/mservice-grpc-apis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

Define firstmeetgames mservice grpc api :

  • hello : hello sample api
  • zommon : is a share library for all above api projects

API Design Guide

How to use mservice-grpc-apis in your JAVA application

Step 1. Add the JitPack repository to your build file

Add it in your root build.gradle at the end of repositories:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Step 2. Find the dependencies

master 分支

If you want to trigger the build immediately, you may click the below link:

  1. https://jitpack.io/com/github/firstmeetgames/mservice-grpc-apis/master-SNAPSHOT/build.log
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

release 分支

If you want to trigger the build immediately, you may click the below link:

  1. https://jitpack.io/com/github/firstmeetgames/mservice-grpc-apis/V1.0.0.RELEASE/build.log
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

Step 3. Add dependencies as needed To your build.gradle

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'
}

Building ahead of time for firstmeetgames.mservice-grpc-apis

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.

Design

  1. https://cloud.google.com/apis/design/
  2. Envoy and gRPC-Web: a fresh new alternative to REST
  3. Seamless Cloud-Native Apps with gRPC-Web and Istio

Reference

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.

  1. This guide gets you started with gRPC-Web with a simple working example from the browser.
  2. https://github.com/improbable-eng/grpc-web
  3. https://github.com/grpc-ecosystem/grpc-gateway
  4. 使用gRPC-Gateway快速构建微服务
  5. Our Experience Designing and Building gRPC Services
  6. gRPC Server side load balancing with Envoy proxy
  7. How we built Monzo Chat on Android
  8. This page documents habits and styles I've found useful when working with gRPC and Protocol Buffers.

Pagination

About

firstmeet 微服务grpc api

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •