- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想使用来自 protoc-gen-grpc-kotlin 的 protoc-gen-grpc-kotlin-1.0.0我得到了
Execution failed for task ':generateProto'.
> Could not resolve all files for configuration ':protobufToolsLocator_grpckt'.
> Could not find protoc-gen-grpc-kotlin-1.0.0-windows-x86_64.exe (io.grpc:protoc-gen-grpc-kotlin:1.0.0).
Searched in the following locations:
https://repo.maven.apache.org/maven2/io/grpc/protoc-gen-grpc-kotlin/1.0.0/protoc-gen-grpc-kotlin-1.0.0-windows-x86_64.exe
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
整个堆栈跟踪是
C:\_d\toLearn\demo-grpc-jaeger>gradle clean build --stacktrace
> Task :generateProto FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':generateProto'.
> Could not resolve all files for configuration ':protobufToolsLocator_grpckt'.
> Could not find protoc-gen-grpc-kotlin-1.0.0-windows-x86_64.exe (io.grpc:protoc-gen-grpc-kotlin:1.0.0).
Searched in the following locations:
https://repo.maven.apache.org/maven2/io/grpc/protoc-gen-grpc-kotlin/1.0.0/protoc-gen-grpc-kotlin-1.0.0-windows-x86_64.exe
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':generateProto'.
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:38)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76)
at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:41)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:372)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:359)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:352)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:338)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':protobufToolsLocator_grpckt'.
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.rethrowFailure(DefaultConfiguration.java:1282)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.access$1700(DefaultConfiguration.java:139)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.visitArtifacts(DefaultConfiguration.java:1259)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.visitContents(DefaultConfiguration.java:1252)
at org.gradle.api.internal.file.AbstractFileCollection.visitStructure(AbstractFileCollection.java:326)
at org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection.lambda$calculateFinalizedValue$0(DefaultConfigurableFileCollection.java:249)
at org.gradle.api.internal.file.collections.UnpackingVisitor.add(UnpackingVisitor.java:61)
at org.gradle.api.internal.file.collections.UnpackingVisitor.add(UnpackingVisitor.java:94)
at
...
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:372)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:359)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:352)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:338)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Caused by: org.gradle.internal.resolve.ArtifactNotFoundException: Could not find protoc-gen-grpc-kotlin-1.0.0-windows-x86_64.exe (io.grpc:protoc-gen-grpc-kotlin:1.0.0).
Searched in the following locations:
https://repo.maven.apache.org/maven2/io/grpc/protoc-gen-grpc-kotlin/1.0.0/protoc-gen-grpc-kotlin-1.0.0-windows-x86_64.exe
at org.gradle.internal.resolve.result.DefaultBuildableArtifactResolveResult.notFound(DefaultBuildableArtifactResolveResult.java:28)
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository$LocateInCacheRepositoryAccess.resolveArtifactFromCache(CachingModuleComponentRepository.java:345)
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository$LocateInCacheRepositoryAccess.resolveArtifact(CachingModuleComponentRepository.java:297)
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ErrorHandlingModuleComponentRepository$ErrorHandlingModuleComponentRepositoryAccess.lambda$resolveArtifact$15(ErrorHandlingModuleComponentRepository.java:181)
at
...
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:41)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:372)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:359)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:352)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:338)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
* Get more help at https://help.gradle.org
BUILD FAILED in 2s
4 actionable tasks: 4 executed
C:\_d\toLearn\demo-grpc-jaeger>
如果它添加了一些有用的信息,如果我大幅降级版本,则会导致不同的错误。
使用实现(“io.grpc:protoc-gen-grpc-kotlin:0.1.2”)
C:\_d\toLearn\demo-grpc-jaeger\build\tmp\kapt3\stubs\main\com\tolearn\DemoGrpcJaegerServiceGrpcKt.java:35: error: incompatible types: NonExistentClass cannot be converted to Annotation
@error.NonExistentClass()
将错误指向自动生成的 stub
这里是完整的build.gradle
plugins {
id("org.jetbrains.kotlin.jvm") version "1.4.10"
id("org.jetbrains.kotlin.kapt") version "1.4.10"
id("org.jetbrains.kotlin.plugin.allopen") version "1.4.10"
id("com.github.johnrengelman.shadow") version "6.1.0"
id("io.micronaut.application") version "1.2.0"
id("com.google.protobuf") version "0.8.13"
}
version = "0.1"
group = "com.tolearn"
repositories {
mavenCentral()
jcenter()
}
micronaut {
testRuntime("junit5")
processing {
incremental(true)
annotations("com.tolearn.*")
}
}
dependencies {
implementation("io.grpc:protoc-gen-grpc-kotlin:1.0.0")
implementation("io.micronaut:micronaut-validation")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlinVersion}")
implementation("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}")
implementation("io.micronaut.kotlin:micronaut-kotlin-runtime")
implementation("io.micronaut:micronaut-runtime")
implementation("io.micronaut.grpc:micronaut-grpc-runtime")
implementation("javax.annotation:javax.annotation-api")
implementation("io.micronaut:micronaut-http-client")
implementation("io.micronaut:micronaut-tracing")
runtimeOnly("io.jaegertracing:jaeger-thrift")
runtimeOnly("ch.qos.logback:logback-classic")
runtimeOnly("com.fasterxml.jackson.module:jackson-module-kotlin")
}
application {
mainClass.set("com.tolearn.ApplicationKt")
}
java {
sourceCompatibility = JavaVersion.toVersion("11")
}
tasks {
compileKotlin {
kotlinOptions {
jvmTarget = "11"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "11"
}
}
}
sourceSets {
main {
java {
srcDirs("build/generated/source/proto/main/grpc")
srcDirs 'build/generated/source/proto/main/grpckt'
srcDirs("build/generated/source/proto/main/java")
}
}
}
protobuf {
protoc { artifact = "com.google.protobuf:protoc:3.14.0" }
plugins {
grpc { artifact = "io.grpc:protoc-gen-grpc-java:1.33.1" }
grpckt { artifact = "io.grpc:protoc-gen-grpc-kotlin:1.0.0" }
}
generateProtoTasks {
all()*.plugins {
grpc {}
grpckt {}
}
}
}
整个项目可以从github克隆
所以我直接的问题是:如何添加 protoc-gen-grpc-kotlin-1.0.0?
第二个问题:我看到几个使用 kapt(enforcedPlatform ... 和 implementation(enforcedPlatform ... 的示例,如下面的示例所示
dependencies {
kapt(enforcedPlatform("io.micronaut:micronaut-bom:$micronautVersion"))
kapt("io.micronaut:micronaut-inject-java")
kapt("io.micronaut:micronaut-validation")
implementation(enforcedPlatform("io.micronaut:micronaut-bom:$micronautVersion"))
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlinVersion}")
implementation("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinxCoroutinesVersion")
implementation("io.micronaut:micronaut-runtime")
implementation("io.micronaut.grpc:micronaut-grpc-server-runtime:$micronautGrpcVersion")
implementation("io.micronaut.grpc:micronaut-grpc-client-runtime:$micronautGrpcVersion")
implementation("io.grpc:grpc-kotlin-stub:${grpcKotlinVersion}")
“kapt(enforcedPlatform”和“implementation(enforcedPlatform”) 的目的是什么?我的问题是否应该与缺少 enforcedPlataform 之一有关?
*** 编辑 1
现在我得到
Microsoft Windows [versão 10.0.18363.1256]
(c) 2019 Microsoft Corporation. Todos os direitos reservados.
C:\_d\toLearn\demo-grpc-jaeger>gradle clean build --stacktrace
> Task :kaptKotlin FAILED
C:\_d\toLearn\demo-grpc-jaeger\build\tmp\kapt3\stubs\main\com\tolearn\DemoGrpcJaegerServiceGrpcKt.java:35: error: incompatible types: NonExistentClass cannot be converted to Annotation
@error.NonExistentClass()
^
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':kaptKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
> java.lang.reflect.InvocationTargetException (no error message)
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':kaptKotlin'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:200)
at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:263)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:198)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:179)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:109)
at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:62)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
...
at org.jetbrains.kotlin.kapt3.base.incremental.IncrementalAptCache.updateCache(IncrementalAptCache.kt:26)
at org.jetbrains.kotlin.kapt3.base.incremental.JavaClassCacheManager.updateCache(cache.kt:22)
at org.jetbrains.kotlin.kapt3.base.AnnotationProcessingKt.doAnnotationProcessing(annotationProcessing.kt:86)
at org.jetbrains.kotlin.kapt3.base.AnnotationProcessingKt.doAnnotationProcessing$default(annotationProcessing.kt:34)
at org.jetbrains.kotlin.kapt3.base.Kapt.kapt(Kapt.kt:45)
... 31 more
* Get more help at https://help.gradle.org
BUILD FAILED in 8s
8 actionable tasks: 8 executed
C:\_d\toLearn\demo-grpc-jaeger>
有了这个 build.gradle
plugins {
id("org.jetbrains.kotlin.jvm") version "1.4.10"
id("org.jetbrains.kotlin.kapt") version "1.4.10"
id("org.jetbrains.kotlin.plugin.allopen") version "1.4.10"
id("com.github.johnrengelman.shadow") version "6.1.0"
id("io.micronaut.application") version "1.2.0"
id("com.google.protobuf") version "0.8.13"
}
version = "0.1"
group = "com.tolearn"
repositories {
mavenCentral()
jcenter()
}
micronaut {
testRuntime("junit5")
processing {
incremental(true)
annotations("com.tolearn.*")
}
}
//https://stackoverflow.com/a/55646891/4148175
//kapt {
// correctErrorTypes true
//}
dependencies {
//implementation("io.grpc:protoc-gen-grpc-kotlin:1.0.0")
implementation("io.micronaut:micronaut-validation")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlinVersion}")
implementation("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}")
implementation("io.micronaut.kotlin:micronaut-kotlin-runtime")
implementation("io.micronaut:micronaut-runtime")
implementation("io.micronaut.grpc:micronaut-grpc-runtime")
implementation("javax.annotation:javax.annotation-api")
implementation("io.micronaut:micronaut-http-client")
implementation("io.micronaut:micronaut-tracing")
runtimeOnly("io.jaegertracing:jaeger-thrift")
runtimeOnly("ch.qos.logback:logback-classic")
runtimeOnly("com.fasterxml.jackson.module:jackson-module-kotlin")
}
application {
mainClass.set("com.tolearn.ApplicationKt")
}
java {
sourceCompatibility = JavaVersion.toVersion("11")
}
tasks {
compileKotlin {
kotlinOptions {
jvmTarget = "11"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "11"
}
}
}
sourceSets {
main {
java {
srcDirs("build/generated/source/proto/main/grpc")
srcDirs 'build/generated/source/proto/main/grpckt'
srcDirs("build/generated/source/proto/main/java")
}
}
}
protobuf {
protoc { artifact = "com.google.protobuf:protoc:3.14.0" }
plugins {
grpc { artifact = "io.grpc:protoc-gen-grpc-java:1.33.1" }
grpckt { artifact = "io.grpc:protoc-gen-grpc-kotlin:1.0.0:jdk7@jar"}
}
generateProtoTasks {
all()*.plugins {
grpc {}
grpckt {}
}
}
}
和 gradle.properties
micronautVersion=2.2.1
kotlinVersion=1.4.10
最佳答案
从版本 0.2.0 开始,protoc-gen-grpc-kotlin 是一个 Jar 而不是依赖于平台的二进制文件 ( https://repo1.maven.org/maven2/io/grpc/protoc-gen-grpc-kotlin/1.0.0/ )。所以在你的 protobuf
配置 block 中,它应该是 grpckt { artifact = "io.grpc:protoc-gen-grpc-kotlin:1.0.0:jdk7@jar"}
.
(请注意,如果您未指定工件扩展,protobuf 插件将根据您的平台选择一个。)
此外,您可能不需要在项目的依赖项中使用 implementation("io.grpc:protoc-gen-grpc-kotlin:1.0.0")
。
关于kotlin - 找不到 protoc-gen-grpc-kotlin-1.0.0-windows-x86_64.exe (io.grpc :protoc-gen-grpc-kotlin:1. 0.0),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65385305/
关于 gRPC Health Checking ,如果 gRPC 服务托管在与其他也需要健康检查的 HTTP 服务相同的端口上,则对 grpc.health.v1.Health.Check 的响应应该
我的项目是读取服务器中的图像,进行一些处理,然后将整个图像传递给客户端。客户端占用图像并进行更多处理,并将一些输出值返回给服务器。服务器和客户端之间使用的图像大小为 [640x480x3]。 以下是我
gRPC 基于 HTTP/2,它(假设)被浏览器广泛支持。因此,我觉得从浏览器使用 gRPC 应该没有问题。 但是,很明显存在问题。协议(protocol),grpc web , 是不同的,因为“由于
关于服务器端代码的幂等性的问题,或者说它的必要性。对于一般的 gRPC,或者专门针对 java 实现。 当我们从客户端发送消息一次时,是否有可能由我们的服务实现处理两次?也许这与服务似乎不可用时的重试
假设我想使用 Grpc Server 流式传输或双向流式传输。 考虑到它在底层使用 http/2,流可以持续多长时间是否有任何限制? 如果是的话,它可以用来代替消息总线,这样流就可以打开并存活多久?
使用 gRPC 向客户端发送有关错误的更多详细信息的模式是什么? 例如,假设我有一个用于注册用户的表单,用于发送消息 message RegisterUser { string email = 1
我是 GRPC 的新手。我想知道当 GRPC 客户端启动一个请求时,服务器是否启动一个新线程来处理。 最佳答案 最多可能有一个 Runnable加入 Server's executor用于申请处理。每
我想传输一个 int64 数组。 我查了一下如何使用它。在我的原型(prototype)文件中,我需要一个流: service myService { rpc GetValues(myRequ
通常,客户端可以通过以下方式取消 gRPC 调用: (requestObserver as ClientCallStreamObserver) .cancel("Cancelled", nul
在 100Gb 网络上,我创建了一个服务器来监听 4 个端口,grpc 客户端可以达到 3GB+/s 的吞吐量。然而,当服务器监听一个端口时,grpc 客户端达到了 1GB/s 的吞吐量,即使我设置了
我想验证调用并可能在服务器拦截器中回答错误。有没有办法做到这一点?如果是,我该如何实现? 最佳答案 简单地从拦截器响应 RPC,可能通过调用 close() ,不要调用next .您仍然需要返回一个监
我有一个 GRPC API,经过重构,一些包被重命名。这包括我们定义 API 的原型(prototype)文件之一中的 package 声明。像这样的: package foo; service Ba
我想在 Ubuntu 上使用源代码中的所有子模块编译 grpc,并将其安装到/usr/local 以外的指定位置 为提供的 Makefile 指定此位置的方法是什么(类似于配置脚本的 --prefix
我不断在控制台中收到此警告: DeprecationWarning: grpc.load: Use the @grpc/proto-loader module with grpc.loadPackag
上下文 我正在尝试使用 Google 的 Cloud Natural Language API。我有我的服务帐户 key JSON 文件,并且正在尝试编写一个简单的 .NET Core 应用程序(更具
用户在测试中遇到了此崩溃。我的第一个猜测是这与内存有关,但除此之外我没有什么可做的。更深入地研究代码,我认为这可能是主线程问题,但看起来监听器在后台线程上被删除,所以我怀疑这就是原因。 我认为在应用程
我正在编写一个 grpc 服务并在 Kubernetes (https://github.com/grpc-ecosystem/grpc-health-probe) 上使用 gRPC 健康检查。在我的
如何使用 gRPC-java 实现检测网络错误并尝试从中恢复的策略?我知道 UNAVAILABLE 状态可能意味着网络错误,但这并没有告诉我它是哪种网络错误 - 并且 UNAVAILABLE 也可以从
假设我们有一个 Search-Service service Search { rpc Search (SearchRequest) returns (SearchReply) {} } mess
如果浏览器支持http/2,为什么 grpc-web 需要 envoy 代理? 不支持 http/2 的旧浏览器是否只需要它? 最佳答案 回答于 https://github.com/grpc/grp
我是一名优秀的程序员,十分优秀!