26 questions
0
votes
1
answer
65
views
How to have graceful shutdown for gRPC server in Spring Boot
I was looking for a way to have a graceful shutdown period for my Spring Boot application, which acts as a gRPC server. I did everything this
reference document said, but it did not work.
I tested ...
1
vote
1
answer
191
views
Getting error error: cannot find symbol private static final com.google.protobuf.Internal.IntListAdapter.IntConverter
I have updated the com.google.protobuf:protoc version from 4.27.5 to 4.28.0 in my android project. The protobuf block has a defination like this
protobuf {
//dependency versions are defined under ...
2
votes
1
answer
244
views
How to generate only Kotlin code (gRPC stubs and Protobuf messages) for an Android application using gRPC?
I am developing an Android application that uses gRPC for communication with a backend service. Currently, my build script generates both Java and Kotlin code from .proto files using the protoc-gen-...
2
votes
0
answers
70
views
"Duplicate class com.google.protobuf.AbstractMessageLite" error when building grpc in android kotlin
I am getting started with grpc + kotlin (android). I am trying to build a simple HelloWorld app but getting following error when trying to build the app:
Caused by: java.lang.RuntimeException: ...
-1
votes
2
answers
326
views
received UNAVAILABLE during grpc call: Trust anchor for certification not found
i have the following code for grpc:
val port = 9090
val metadata = Metadata()
metadata.put(Metadata.Key.of("Authorization", Metadata.ASCII_STRING_MARSHALLER), "Bearer ...
1
vote
0
answers
763
views
use same request or response for multiple RPC
I encountered the error
path-to/my_service.proto:25:3:"c.BookRequest" is used as the request or response type for multiple RPCs.
I have created a couple of RPC that have same request ...
0
votes
0
answers
125
views
Getting Server response: UNAVAILABLE even after following the steps of "QUICK START kotlin gRPC on android"
I have followed all the steps given in gRPC Kotlin QUICK START, I built and ran the server successfully and installed the Android app (Connected with adb over TCP in local network, same subnet, PC ...
1
vote
1
answer
530
views
Loader Constraint Violation for class io.grpc.Channel when trying to create ManagedChannel for GRPC Request
I'm trying to setup grpc client to make inference requests to Nvidia Triton inference server (version:23.06-py3) in Kotlin for my project.
I've setup protoc code generation using gradle (attached ...
1
vote
1
answer
286
views
Kotlin Coroutines SharedFlow collector lost some data with gRPC Kotlin
I tried to use SharedFlow with gRPC Server side stream.
var sharedFlow: SharedFlow<T>? = null
fun createStream(): SharedFlow<T> {
val stub = ServiceGrpcKt.Stub(channel)
return stub....
1
vote
0
answers
466
views
Does com.google.common.util.concurrent.ListenableFuture .get() inside a coroutine blocks the thread even in `runInterruptible`
Using gRPC response of com.google.common.util.concurrent.ListenableFuture and calling get on it, is it blocking the thread that does the get() call?
Or because I'm inside a coroutine the thread is ...
1
vote
0
answers
209
views
How to enable gRPC-Gateway in Kotlin
I wanted to test out gRPC to potentially swap our existing system to work with it.
The issue
I cloned grpc-kotlin to use their examples and chose to set up hellowworld example.
Following all the ...
1
vote
2
answers
6k
views
Do gRPC clients have any caching functionality?
Do gRPC clients have any caching functionality, e.g. like GraphQL clients have? Without having tried gRPC yet, that's currently the only thing that would keep me from doing tihs.
0
votes
2
answers
3k
views
INVALID_ARGUMENT: RESOURCE_EXHAUSTED: Connection closed after GOAWAY
I'd like to alter the parameter GRPC_ARG_HTTP2_MAX_PING_STRIKES as documented here (https://github.com/grpc/grpc/blob/master/doc/keepalive.md).
with a default value of 2. Want to change it to tolerate ...
3
votes
2
answers
1k
views
grpc-kotlin: Unresolved reference
I try to compile proto definitions into kotlin stubs, but get import issues. My gradle is
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.21.2"
}
plugins {
...
1
vote
1
answer
1k
views
GRPC call for a service which is inside a subdirectory? (Android grpc client)
This question is similar to below but my issue is with Android grpc client
How can I make a GRPC call for a service which is inside a subdirectory? (in .Net Framework)
I am getting 404 error while ...
0
votes
0
answers
1k
views
Suppress deprecated warnings on Kotlin deprecated methods
I'm working on a project that uses grpc/grpc-kotlin to generate a Kotlin-idiomatic interface for interacting with gRPC Services and noticed the generated code has some warnings related to use of ...
0
votes
1
answer
272
views
IntelliJ not correctly analyzing grpc-kotlin generated code
I have followed the instructions here: https://github.com/grpc/grpc-kotlin/tree/master/compiler for Gradle, and everything is working fine, but IntelliJ is seeing errors in the generated code, even ...
2
votes
1
answer
2k
views
Tests failing when using ClientInterceptor to add headers to the stub
In the following code MetadataUtils.attachHeaders is deprecated (I'm using grpc 1.45.1):
"request without bearer token should fail" {
val channel: ManagedChannel = ...
2
votes
1
answer
1k
views
Transcode HTTP header into Grpc metadata for each request
I'am building an API-Gateway that proxies HTTP traffic to Grpc services. All incoming HTTP requests can have JWT in Authorization header. I need to transcode this JWT to Grpc metadata at each request ...
2
votes
1
answer
710
views
RetryPolicy does not work with coroutines
I made a simple gRPC server in Kotlin with coroutines and a client with Java. In the cliente I enabled and configured a retry policy, but it does was not work. I speend a lot of time to find a ...
2
votes
1
answer
317
views
Need wire to emit interfaces for client and server in same gradle project
I want to use interfaces for both client and server in the same android app. Usecase is to run a okhttpmockwebserver serving gRPC requests within the same app the client is running in. For this i ...
11
votes
3
answers
4k
views
How do you add gRPC to Android Studio with Kotlin?
Task
I need to connect an Android client with a python server using gRPC. Making the server and generating the protos was easy in Python, but the lack of tutorials and confusing documentation for the ...
1
vote
1
answer
707
views
Android adding authorization header to grpc Stub, Error:"onError: io.grpc.StatusRuntimeException: UNAVAILABLE"
I am unable to add the header successfully using
// create a custom header
val header: io.grpc.Metadata = io.grpc.Metadata()
val auth: io.grpc.Metadata.Key<String> = io.grpc.Metadata.Key....
0
votes
1
answer
2k
views
gRPC Context return null when I use SimpleForwardingServerCallListener
I want to override sendMessage, sendHeaders, onMessage, onHalfClose methods in ServerInterceptor (with Context):
val context = Context.current().withValue(TestConstants.CONTEXT_KEY, "testValue1&...
1
vote
1
answer
550
views
How use Wire with Flow in client gRPC?
i need stream of a service gRPC with Wire and need use Flow on client, but executeBlocking() do not provide method with return via Flow, need implementation manual via flow emits?
0
votes
1
answer
1k
views
How can I access header in a service?
I'm trying to handle JWT-authentication in gRPC on my backend. I can extract the JWT in an interceptor but how do I access it in my service? I think it should be done with a ...