Skip to content

A sample project for building a minimum gRPC interface artifact.

Notifications You must be signed in to change notification settings

shihpeng/grpc-sample-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

grpc-sample-api

This project tries to make the gRPC code generation easy.

How to use

Since each of the Java app using gRPC should separate API interfaces from the actual implementation, it would be convenient if we use a scaffold project for helping us to generate the gRPC code.

  1. When you need to build a gRPC service, first clone this repository to your workspace.
  2. Define your API interface and DTO (Data Transfer Object) in proto files in src/main/proto.
  3. Use one of the following commands to generate your artifact.
  4. Include the packaged artifact in your project.

Compile and install the artifact to your local Maven repo.

If you are just in developing your service and do not need to deploy the artifact to anywhere else. The following command would compile and install the package jar into your local repository.

$ mvn install

You can find the jar in somewhere like ~/.m2/repository/io/shihpeng/grpc-sample-api/0.0.1-SNAPSHOT/

Compile and deploy the artifact to the remote Maven repo.

Use the following command if you have done the development and want to deploy the artifact to a remote Maven repository so that the deploy pipeline could access the artifact.

$ mvn deploy

If you see any error message while trying to connect the repo, please check and update the connection information within the <distributionManagement> section in the pom.xml file.

Compile and just package the artifact as a jar.

Use the following command if you only need to package the artifact as a jar file.

$ mvn -o package

You can find the built jar in the following folder <project>/target/.

About

A sample project for building a minimum gRPC interface artifact.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published