Using Spring Boot together with gRPC and Protobuf

后端 未结 6 1874
傲寒
傲寒 2021-01-31 02:30

Anyone having any examples or thoughts using gRPC together with Spring Boot?

6条回答
  •  执笔经年
    2021-01-31 02:46

    In here I use gRpc and eureka to communication. This project based on Spring-boot

    https://github.com/WThamira/grpc-spring-boot

    additionally you canuse register as consul also. full example in this repo

    https://github.com/WThamira/gRpc-spring-boot-example

    this maven dependency help to gRpc

            
                io.grpc
                grpc-stub
                1.0.1
            
            
                io.grpc
                grpc-protobuf
                1.0.1
            
            
                io.grpc
                grpc-netty
                1.0.1
            
    

    and need plugin show in below

           
                    org.xolstice.maven.plugins
                    protobuf-maven-plugin
                    0.5.0
                    
                        
                        com.google.protobuf:protoc:3.0.2:exe:${os.detected.classifier}
                        grpc-java
                        io.grpc:protoc-gen-grpc-java:1.0.1:exe:${os.detected.classifier}
                    
                    
                        
                            
                                compile
                                compile-custom
                            
                        
                    
                
    

提交回复
热议问题