Skip to content

Commit 1deca8f

Browse files
committed
Use 'grpcServer' utility
1 parent 2b0bd54 commit 1deca8f

File tree

1 file changed

+3
-7
lines changed
  • jacodb-ets/wire-server/src/main/kotlin/org/jacodb/ets/service

1 file changed

+3
-7
lines changed

jacodb-ets/wire-server/src/main/kotlin/org/jacodb/ets/service/Greeter.kt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ import greeter.GreeterBlockingServer
2020
import greeter.GreeterWireGrpc
2121
import greeter.HelloReply
2222
import greeter.HelloRequest
23-
import io.grpc.ServerBuilder
24-
import io.grpc.protobuf.services.ProtoReflectionService
2523
import io.grpc.stub.StreamObserver
2624

2725
private val logger = mu.KotlinLogging.logger {}
@@ -46,11 +44,9 @@ class GreeterService : GreeterWireGrpc.GreeterImplBase() {
4644

4745
fun main() {
4846
val port = 7777
49-
val server = ServerBuilder
50-
.forPort(port)
51-
.addService(GreeterService())
52-
.addService(@Suppress("DEPRECATION") ProtoReflectionService.newInstance())
53-
.build()
47+
val server = grpcServer(port) {
48+
addService(GreeterService())
49+
}
5450
server.start()
5551
println("Server listening on port ${server.port}")
5652
server.awaitTermination()

0 commit comments

Comments
 (0)