Skip to content

Commit 4b10d8a

Browse files
refactor: allow building service using definition (#59)
1 parent 38f5460 commit 4b10d8a

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

platform-grpc-service-framework/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ dependencies {
1010
api(platform("io.grpc:grpc-bom:1.47.0"))
1111
api("io.grpc:grpc-api")
1212
api("io.grpc:grpc-services")
13-
api("org.hypertrace.core.grpcutils:grpc-client-utils:0.7.6")
13+
api("org.hypertrace.core.grpcutils:grpc-client-utils:0.9.1")
1414
api("com.typesafe:config:1.4.2")
1515
api(project(":service-framework-spi"))
1616

1717
annotationProcessor("org.projectlombok:lombok:1.18.24")
1818
compileOnly("org.projectlombok:lombok:1.18.24")
1919

2020
implementation("org.slf4j:slf4j-api:1.7.36")
21-
implementation("org.hypertrace.core.grpcutils:grpc-server-utils:0.7.6")
21+
implementation("org.hypertrace.core.grpcutils:grpc-server-utils:0.9.1")
2222
}
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
package org.hypertrace.core.serviceframework.grpc;
22

33
import io.grpc.BindableService;
4+
import io.grpc.ServerServiceDefinition;
45
import lombok.Value;
56

67
@Value
78
public class GrpcPlatformService {
8-
BindableService grpcService;
9+
ServerServiceDefinition grpcServiceDefinition;
10+
11+
public GrpcPlatformService(BindableService grpcService) {
12+
this(grpcService.bindService());
13+
}
14+
15+
public GrpcPlatformService(ServerServiceDefinition grpcService) {
16+
this.grpcServiceDefinition = grpcService;
17+
}
918
}

platform-grpc-service-framework/src/main/java/org/hypertrace/core/serviceframework/grpc/GrpcPlatformServiceContainer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ private ConstructedServer constructServer(
9494
serverDefinition.getServiceFactories().stream()
9595
.map(factory -> factory.buildServices(containerEnvironment))
9696
.flatMap(Collection::stream)
97-
.map(GrpcPlatformService::getGrpcService)
97+
.map(GrpcPlatformService::getGrpcServiceDefinition)
9898
.map(InterceptorUtil::wrapInterceptors)
9999
.forEach(
100100
service -> {

platform-http-service-framework/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55

66
dependencies {
77
api(project(":platform-service-framework"))
8-
api("org.hypertrace.core.grpcutils:grpc-client-utils:0.7.6")
8+
api("org.hypertrace.core.grpcutils:grpc-client-utils:0.9.1")
99
api("com.typesafe:config:1.4.2")
1010
api("javax.servlet:javax.servlet-api:4.0.1")
1111
api("com.google.inject:guice:5.1.0")

0 commit comments

Comments
 (0)