Uh oh!
There was an error while loading. Please reload this page.
Generate Kotlin gRPC Stubs - #169
Conversation
Signed-off-by: Pedro Tôrres <t0rr3sp3dr0@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@## main #169 +/- ##
============================================
- Coverage 88.26% 88.16% -0.11% + Complexity 298 297 -1
============================================
Files 31 31 Lines 980 980 Branches 78 78 ============================================
- Hits 865 864 -1
Misses 85 85 - Partials 30 31 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
slonka
commented
Jun 6, 2021
Hi, I will test it in Envoy-Control and check if it works and if it does i'll review it and merge it. |
t0rr3sp3dr0
commented
Jun 22, 2021
Hi @slonka! Were you able to verify this works? |
| <dependency> | ||
| <groupId>org.jetbrains.kotlinx</groupId> | ||
| <artifactId>kotlinx-coroutines-core</artifactId> |
There was a problem hiding this comment.
In Kotlin, the base implementations of gRPC services use coroutines to deal with blocking operations. This way, developers don't need to deal with StreamObservers like they have to do in Java and just implement a suspend function that returns the object directly.
Java implementation:
https://github.com/grpc/grpc-java/blob/c540229d79c6d8d29da34d22c3c5add2138bdc87/examples/src/main/java/io/grpc/examples/helloworld/HelloWorldServer.java#L81-L89
Kotlin implementation:
https://github.com/grpc/grpc-kotlin/blob/b7d06483bf597cd4a10e3ed2ef52b21ca95c80ad/examples/server/src/main/kotlin/io/grpc/examples/helloworld/HelloWorldServer.kt#L48-L53
slonka
commented
Jun 23, 2021
Hi @t0rr3sp3dr0 - sorry for the delay. I've run into a bit of a problem, after leaving Allegro I no longer can release SNAPSHOTs of java-control-plane. I'm getting |
t0rr3sp3dr0
commented
Nov 8, 2021
t0rr3sp3dr0
commented
Dec 13, 2021
t0rr3sp3dr0
commented
Feb 2, 2022
@rulex123 and @onemanbucket, are you able to take a look on this PR? |
t0rr3sp3dr0
commented
Mar 10, 2022
@rulex123 and @onemanbucket, sorry to ping you again, but it seems you are the only ones contributing to this repository at the moment. I even sent a message on the control-plane-dev channel on Slack to find other maintainers, but got no answer (https://envoyproxy.slack.com/archives/C7LDJTM6Z/p1644537207034489). I would appreciate if you could review this patch. |
t0rr3sp3dr0
commented
Mar 24, 2022
Hi everyone! Sorry to tag all the project maintainers here, but I've been trying to get someone to review this PR for over 9 months now and I've had no success so far. If someone can take a look here, I'd really appreciate it! 🙂 @Automaat@Ferdudas97@b-hoyt@chemicL@gawarz@joeyb@kukulam-allegro@lukidzi@mpuncel@ramaraochavali@slonka@snowp |
nothrow
commented
Oct 10, 2024
hello, is any update on this PR/item? I'd really appreciate it as well. |
This patch modifies build configuration files to generate gRPC Stubs for Kotlin and place them inside the built artifact. The changes were based on official tutorials on how to configure maven-protobuf-plugin to generate Kotlin gRPC Stubs (https://github.com/grpc/grpc-kotlin/tree/master/compiler) and how to build Kotlin with Maven (https://kotlinlang.org/docs/maven.html).
In the built JAR, for each ServiceGrpc class generated from a gRPC service definition on proto files, a new class called ServiceGrpcKt is introduced with the Kotlin interface. I've tested it on a Java-only project to make sure it doesn't cause any problem.
The built artifact is available on JitPack: https://jitpack.io/#t0rr3sp3dr0/java-control-plane/3bd90153d9.
Closes#168