JavaFX gRPC 客户端依赖项 [英] JavaFX gRPC Client Dependencies

查看:51
本文介绍了JavaFX gRPC 客户端依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究 gRPC 客户端(JavaFX)和服务器(带有 gRPC 启动器的 SpringBoot).这两个应用程序是独立的,不会一起共享任何文件.服务器已完成测试(此处)

I am working on gRPC client(JavaFX) and server(SpringBoot with gRPC starter). The two application are independent and do not share any files together. The server is complete for testing(here)

我想让 JavaFX 客户端独立于 gRPC 服务器,即不包括 gRPC 服务器作为客户端 POM 中的 maven 依赖项.

I would like to make JavaFX client independently from the gRPC server, i.e without including gRPC server as a maven dependancy in client POM.

我可以在 javafx 应用程序中添加哪些特定于 gRPC 客户端的依赖项以及如何向服务器发送请求?

What gRPC client specific dependencies can i add in the javafx application and how to send request to the server?

推荐答案

根据官方文档(http://www.grpc.io/docs/quickstart/java.html) 示例可以用作起点 https://github.com/grpc/grpc-java/blob/master/examples/build.gradle

According to the official documentation (http://www.grpc.io/docs/quickstart/java.html) the examples can be used as a starting point https://github.com/grpc/grpc-java/blob/master/examples/build.gradle

你需要的依赖是

compile "io.grpc:grpc-netty:${grpcVersion}"
compile "io.grpc:grpc-protobuf:${grpcVersion}"
compile "io.grpc:grpc-stub:${grpcVersion}"

其中 ${grpcVersion} 是您可能想要使用的任何已发布的 gRPC 版本.此符号用于 Gradle 构建工具,但转换为 Maven 坐标很容易,例如

where ${grpcVersion} is whatever released version of gRPC you may want to use. This notation is for the Gradle build tool, however transforming to Maven coordinates is easy, such as

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

您会在 https://github.com 上找到另一个工作示例/aalmiray/javatrove/tree/master/chat-02

这篇关于JavaFX gRPC 客户端依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆