Skip to content

Commit

Permalink
Don't limit the size of a gRPC message (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
sideeffffect authored Apr 21, 2020
1 parent 31dc213 commit 0c97550
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ private[jsonbridge] class ReflectionGrpcJsonBridge(serviceHandlers: ServiceHandl
implicit F: Sync[F]): Resource[F, Server] =
Resource {
F.delay {
val b = InProcessServerBuilder.forName(inProcessServiceName).executor(ec.execute(_))
val b = InProcessServerBuilder
.forName(inProcessServiceName)
.maxInboundMessageSize(Int.MaxValue)
.executor(ec.execute(_))
services.foreach(b.addService)
val s = b.build().start()
(s, F.delay { s.shutdown().awaitTermination() })
Expand All @@ -78,7 +81,11 @@ private[jsonbridge] class ReflectionGrpcJsonBridge(serviceHandlers: ServiceHandl
implicit F: Sync[F]): Resource[F, ManagedChannel] =
Resource[F, ManagedChannel] {
F.delay {
val c = InProcessChannelBuilder.forName(inProcessServiceName).executor(ec.execute(_)).build()
val c = InProcessChannelBuilder
.forName(inProcessServiceName)
.maxInboundMessageSize(Int.MaxValue)
.executor(ec.execute(_))
.build()
(c, F.delay { val _ = c.shutdown() })
}
}
Expand Down

0 comments on commit 0c97550

Please sign in to comment.