set gRPC message size limit 32M
This commit is contained in:
@@ -21,6 +21,7 @@ import java.time.Duration
|
|||||||
class Defaults {
|
class Defaults {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
const val maxMessageSize: Int = 32 * 1024 * 1024
|
||||||
val timeout: Duration = Duration.ofSeconds(60)
|
val timeout: Duration = Duration.ofSeconds(60)
|
||||||
val timeoutInternal: Duration = timeout.dividedBy(4)
|
val timeoutInternal: Duration = timeout.dividedBy(4)
|
||||||
val retryConnection: Duration = Duration.ofSeconds(10)
|
val retryConnection: Duration = Duration.ofSeconds(10)
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ open class GrpcServer(
|
|||||||
log.info("Listening Native gRPC on ${mainConfig.host}:${mainConfig.port}")
|
log.info("Listening Native gRPC on ${mainConfig.host}:${mainConfig.port}")
|
||||||
val serverBuilder = NettyServerBuilder
|
val serverBuilder = NettyServerBuilder
|
||||||
.forAddress(InetSocketAddress(mainConfig.host, mainConfig.port))
|
.forAddress(InetSocketAddress(mainConfig.host, mainConfig.port))
|
||||||
.maxInboundMessageSize(Int.MAX_VALUE)
|
.maxInboundMessageSize(Defaults.maxMessageSize)
|
||||||
.let {
|
.let {
|
||||||
if (mainConfig.accessLogConfig.enabled) {
|
if (mainConfig.accessLogConfig.enabled) {
|
||||||
it.intercept(accessHandler)
|
it.intercept(accessHandler)
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ class GrpcUpstreams(
|
|||||||
fun start(): Flux<UpstreamChangeEvent> {
|
fun start(): Flux<UpstreamChangeEvent> {
|
||||||
val chanelBuilder = NettyChannelBuilder.forAddress(host, port)
|
val chanelBuilder = NettyChannelBuilder.forAddress(host, port)
|
||||||
// some messages are very large. many of them in megabytes, some even in gigabytes (ex. ETH Traces)
|
// some messages are very large. many of them in megabytes, some even in gigabytes (ex. ETH Traces)
|
||||||
.maxInboundMessageSize(Int.MAX_VALUE)
|
.maxInboundMessageSize(Defaults.maxMessageSize)
|
||||||
.enableRetry()
|
.enableRetry()
|
||||||
.maxRetryAttempts(3)
|
.maxRetryAttempts(3)
|
||||||
if (auth != null && StringUtils.isNotEmpty(auth.ca)) {
|
if (auth != null && StringUtils.isNotEmpty(auth.ca)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user