您当前的位置: 首页 >  慌途L spring

springboot集成grpc报错:io.grpc.StatusRuntimeException: INTERNAL: Connection closed with unknown cause

慌途L 发布时间:2018-12-07 20:36:05 ,浏览量:5

使用 springboot 集成 grpc 和 protobuf 时出现以下错误:
io.grpc.StatusRuntimeException: INTERNAL: Connection closed with unknown cause
at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:141)
at io.grpc.stub.ServerCalls$1$1.onHalfClose(ServerCalls.java:148)
at io.grpc.internal.SerializingExecutor$TaskRunner.run(SerializingExecutor.java:152)
at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:227)
at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:208)
原因:一系列 io.grpc 依赖版本不匹配
  • 由于我前面使用io.grpc是1.4.0版本,然后请求一直报上面的错误,可以参考以下版本,我改成1.11.0之后就可以了
解决方案:
  • 以下配置pom依赖可以借鉴:结果是可以正常连接的

        
        
            com.google.protobuf
            protobuf-java
            3.6.1
        
        
            com.googlecode.protobuf-java-format
            protobuf-java-format
            1.2
        
        
        
            io.grpc
            grpc-netty
            1.11.0
        
        
            io.grpc
            grpc-protobuf
            1.11.0
        
        
            io.grpc
            grpc-stub
            1.11.0
        
        
            io.grpc
            grpc-all
            1.11.0
        
        
        
            io.netty
            netty-all
            4.1.22.Final
        
        
            io.netty
            netty-tcnative-boringssl-static
            2.0.8.Final
        

        
        
            net.devh
            grpc-client-spring-boot-starter
            1.3.0-RELEASE
        

		
            com.google.api.grpc
            proto-google-common-protos
            1.0.0
        
		
		
           org.xolstice.maven.plugins
            protobuf-maven-plugin
            0.5.0
            
                com.google.protobuf:protoc:3.6.1:exe:${os.detected.classifier}
                grpc-java
                io.grpc:protoc-gen-grpc-java:1.11.0:exe:${os.detected.classifier}
                
                ${project.basedir}/src/main/proto
                
                
                ${project.basedir}/src/main/java
                
                false
            
            
                
                    
                    compile
                    
                        
                        compile
                        
                        compile-custom
                    
                
            
        
关注
打赏
1688896170
查看更多评论

慌途L

暂无认证

  • 5浏览

    0关注

    118博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录

0.0513s