Questions tagged [grpc-kotlin]
18 questions
8
votes
3 answers
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 Kt client makes it appear overwhelmingly…

Adi Călăvie
- 101
- 5
2
votes
1 answer
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 created two library projects with their own wire…

lilienberg
- 1,252
- 11
- 18
1
vote
0 answers
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 free and only resumed when the network response…

Guy Assaf
- 888
- 9
- 24
1
vote
0 answers
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 steps, I initialized the server and everything worked…

nsinnyc
- 11
- 2
1
vote
1 answer
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 accessing the grpc streaming api :
UNIMPLEMENTED:…

FurElise
- 37
- 1
- 7
1
vote
1 answer
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 = ManagedChannelBuilder.forAddress(address, port)
…

Pawel
- 466
- 1
- 7
- 20
1
vote
1 answer
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 and send it with Grpc request. I am using…

Raccoon
- 61
- 8
1
vote
1 answer
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 solution, belivied that my client was broken, but the…
1
vote
1 answer
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 = io.grpc.Metadata.Key.of("authorization",…

Mohammed Aljammali
- 21
- 3
1
vote
1 answer
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?

João Eudes Lima
- 755
- 1
- 11
- 21
0
votes
2 answers
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 0 pings before the connection is closed with a…

Eduardo José
- 25
- 5
0
votes
1 answer
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 {
grpckt {
artifact =…

Andreas
- 51
- 1
- 5
0
votes
0 answers
Grpc kotlin "fake" client stub
I'm going through the gRPC kotlin tutorial here. It is relatively easy to create a client stub and call it like follows:
val channel = ManagedChannelBuilder.forAddress("localhost", 8980).usePlaintext().build()
val stub =…

user4998087
- 317
- 1
- 10
0
votes
0 answers
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 deprecated methods.
> Task :lib:compileKotlin
w:…

Pedro Tôrres
- 49
- 1
- 7
0
votes
1 answer
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 though when I run the application and manually…

Michael
- 51
- 3