Skip to content

Commit

Permalink
Add configuration for max inbound message size (#212)
Browse files Browse the repository at this point in the history
* Add configuration for max inbound message size; set default to 512MB

---------

Co-authored-by: Daniel Slunečko <[email protected]>
  • Loading branch information
okubis and Daniel Slunečko authored Apr 30, 2024
1 parent bf2c2b0 commit 128aca5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ object RabbitMQConnection {
}

factory.setConnectionTimeout(connectionTimeout.toMillis.toInt)
factory.setMaxInboundMessageBodySize(connectionConfig.maxInboundMessageBodySize)
}

// scalastyle:off
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ final case class RabbitMQConnectionConfig(name: String,
networkRecovery: NetworkRecoveryConfig = NetworkRecoveryConfig(),
channelMax: Int = 2047,
credentials: CredentialsConfig,
republishStrategy: RepublishStrategyConfig = RepublishStrategyConfig.DefaultExchange)
republishStrategy: RepublishStrategyConfig = RepublishStrategyConfig.DefaultExchange,
// This is the new hard-limit on server side. see:
// https://github.com/rabbitmq/rabbitmq-common/blob/67c4397ffa9f51d87f994aa4db4a68e8e95326ab/include/rabbit.hrl#L250
maxInboundMessageBodySize: Int = 536870912)

final case class NetworkRecoveryConfig(enabled: Boolean = true, handler: RecoveryDelayHandler = RecoveryDelayHandlers.Linear())

Expand Down

0 comments on commit 128aca5

Please sign in to comment.