Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support grpc-kotlin #24505

Closed
debop opened this issue Mar 23, 2022 · 13 comments
Closed

Support grpc-kotlin #24505

debop opened this issue Mar 23, 2022 · 13 comments
Assignees
Labels
area/grpc gRPC area/kotlin kind/enhancement New feature or request triage/duplicate This issue or pull request already exists

Comments

@debop
Copy link

debop commented Mar 23, 2022

Description

quarkus-grpc support java and mutiny

Can support grpc-kotlin for Kotlin Coroutines ?

link: https://github.com/grpc/grpc-kotlin

Implementation ideas

No response

@debop debop added the kind/enhancement New feature or request label Mar 23, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Mar 23, 2022

@wfrank2509
Copy link

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.

@andreas-eberle
Copy link
Contributor

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}"
            }
        }
    }
}

@rgonciarz
Copy link

rgonciarz commented Oct 28, 2022

Hi Guys, what's the current status for having Quarkus support for coroutine's gRPC stubs?

@evanchooly
Copy link
Member

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.

@hennihaus
Copy link

Coroutine support for GRPC would be a really nice feature.

@mschorsch
Copy link
Contributor

Coroutine support for GRPC would be a really nice feature.

I would say it's a must have 😁

@wfrank2509
Copy link

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.

@mihaipoenaru
Copy link

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.

@dustin-graham
Copy link

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

@elgabbouch
Copy link

+1

@ghatdev
Copy link

ghatdev commented Jun 30, 2024

👍🏼

@cescoffier
Copy link
Member

Duplicate of #39127, and same status. We didn't have the bandwidth to implement this. Contributions are welcome.

@cescoffier cescoffier closed this as not planned Won't fix, can't repro, duplicate, stale Nov 15, 2024
@cescoffier cescoffier added the triage/duplicate This issue or pull request already exists label Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/grpc gRPC area/kotlin kind/enhancement New feature or request triage/duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests