Open debop opened 2 years ago
/cc @cescoffier, @evanchooly, @michalszynkiewicz
Hi ... If I could write something like
@GrpcService
class HelloServiceGrpc(private val service: HelloService) : CoroutineGreeterBase {
override suspend fun sayHello(request: HelloRequest?): HelloReply {
return service.say(request!!)
}
override suspend fun streamHello(request: HelloRequest?): Flow<HelloReply> {
return service.streamHello(request!!)
}
}
CoroutineGreeterBase
being the generated Skeleton.
it would be really nice.
Hi everyone,
here is an example, how it looks like when you do GRPC with Kotlin in Spring Boot. It would be awesome if we could get the same experience in Quarkus with Kotlin and Coroutines (as I really don't want to use Spring Boot :D ). Maybe it would be an idea to have seperate quarkus-grpc-kotlin extension?
the proto file:
syntax = "proto3";
package com.example.grpcdemo.service;
import "google/protobuf/wrappers.proto";
import "google/protobuf/timestamp.proto";
service UserService {
rpc getUserById (google.protobuf.Int64Value) returns (User);
rpc streamBack(google.protobuf.Int64Value) returns (stream User);
rpc twoWayStream(stream User) returns (stream User);
}
message User {
int64 id = 1;
string name = 2;
}
My service with coroutines
@GrpcService
class UserService : UserServiceGrpcKt.UserServiceCoroutineImplBase() {
override suspend fun getUserById(request: Int64Value): Demo.User {
return user {
id = request.value
name = "ddd"
}
}
override fun streamBack(request: Int64Value): Flow<Demo.User> = flow {
(1..request.value).forEach {
val user = user {
id = it
name = "$it name"
}
emit(user)
delay(500)
}
}
override fun twoWayStream(requests: Flow<Demo.User>): Flow<Demo.User> {
return requests.map {
user {
id = it.id + 1000
name = "new ${it.name}"
}
}
}
}
Hi Guys, what's the current status for having Quarkus support for coroutine's gRPC stubs?
I actually started poking at it this week but set it aside when I realized it'd take a chuck of time. I'm trying to clean up some longer standing bugs before deep diving in to something else.
Coroutine support for GRPC would be a really nice feature.
Coroutine support for GRPC would be a really nice feature.
I would say it's a must have 😁
Completely agree that it is a must have. But I would already be happy with a generally deeper integrated Kotlin support for grpc not using the java code generation as intermediate.
Also thinking of using gRPC with my project, but I'm not sure if I should use it as it is now, only to replace it later when it's done. @evanchooly , any idea on a time range, depending on your workload? Weeks? Months? Not looking for a formal commitment or anything, just need to know if I can realistically wait for this or I should just start with what is present in Quarkus right now.
I don't know if its exactly what you're all looking for, but I found this video of a solution to get Kotlin Coroutines and gRPC with Quarkus: https://www.youtube.com/watch?v=CXapiybZIJk&ab_channel=arconsis
+1
👍🏼
Description
quarkus-grpc
support java andmutiny
Can support
grpc-kotlin
for Kotlin Coroutines ?link: https://github.com/grpc/grpc-kotlin
Implementation ideas
No response