Skip to content

Commit 0c97550

Browse files
authored
Don't limit the size of a gRPC message (#67)
1 parent 31dc213 commit 0c97550

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

core/src/main/scala/com/avast/grpc/jsonbridge/ReflectionGrpcJsonBridge.scala

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,10 @@ private[jsonbridge] class ReflectionGrpcJsonBridge(serviceHandlers: ServiceHandl
6767
implicit F: Sync[F]): Resource[F, Server] =
6868
Resource {
6969
F.delay {
70-
val b = InProcessServerBuilder.forName(inProcessServiceName).executor(ec.execute(_))
70+
val b = InProcessServerBuilder
71+
.forName(inProcessServiceName)
72+
.maxInboundMessageSize(Int.MaxValue)
73+
.executor(ec.execute(_))
7174
services.foreach(b.addService)
7275
val s = b.build().start()
7376
(s, F.delay { s.shutdown().awaitTermination() })
@@ -78,7 +81,11 @@ private[jsonbridge] class ReflectionGrpcJsonBridge(serviceHandlers: ServiceHandl
7881
implicit F: Sync[F]): Resource[F, ManagedChannel] =
7982
Resource[F, ManagedChannel] {
8083
F.delay {
81-
val c = InProcessChannelBuilder.forName(inProcessServiceName).executor(ec.execute(_)).build()
84+
val c = InProcessChannelBuilder
85+
.forName(inProcessServiceName)
86+
.maxInboundMessageSize(Int.MaxValue)
87+
.executor(ec.execute(_))
88+
.build()
8289
(c, F.delay { val _ = c.shutdown() })
8390
}
8491
}

0 commit comments

Comments
 (0)