• java 使用grpc步骤


    1、配置grpc maven依赖

    <dependency>
    <groupId>io.grpc</groupId>
    <artifactId>grpc-netty</artifactId>
    <version>1.2.0</version>
    </dependency>
    <dependency>
    <groupId>io.grpc</groupId>
    <artifactId>grpc-protobuf</artifactId>
    <version>1.2.0</version>
    </dependency>
    <dependency>
    <groupId>io.grpc</groupId>
    <artifactId>grpc-stub</artifactId>
    <version>1.2.0</version>
    </dependency>

    2、设置idea 插件

      

    <build>
      <extensions>
        <extension>
          <groupId>kr.motd.maven</groupId>
          <artifactId>os-maven-plugin</artifactId>
          <version>1.4.1.Final</version>
        </extension>
      </extensions>
      <plugins>
        <plugin>
          <groupId>org.xolstice.maven.plugins</groupId>
          <artifactId>protobuf-maven-plugin</artifactId>
          <version>0.5.0</version>
          <configuration>
            <protocArtifact>com.google.protobuf:protoc:3.0.2:exe:${os.detected.classifier}</protocArtifact>
            <pluginId>grpc-java</pluginId>
            <pluginArtifact>io.grpc:protoc-gen-grpc-java:1.2.0:exe:${os.detected.classifier}</pluginArtifact>
          </configuration>
          <executions>
            <execution>
              <goals>
                <goal>compile</goal>
                <goal>compile-custom</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </build>

    相关链接
    https://github.com/grpc/grpc-java
    https://github.com/google/protobuf/tree/master/examples

    可以关注我的公众账户 互联网开发者Club,公众账户分享个性化推荐,搜索,分布式架构,高性能,高可用

  • 相关阅读:
    新创建一个git远程仓库
    GIT安装完需要做以下配置
    Echarts 页面多图自适应的解决办法 (转)
    Error: [$rootScope:inprog] $digest already in progress
    指令的理解-作用域范围
    Python 集合
    Python 字典
    Python笔记 【无序】 【二】
    Python 字符串
    Python 元组
  • 原文地址:https://www.cnblogs.com/freedommovie/p/6771662.html
Copyright © 2020-2023  润新知