Skip to content

Commit

Permalink
chore: update max msg size
Browse files Browse the repository at this point in the history
  • Loading branch information
higor-duarte-oliveira committed Feb 7, 2025
1 parent 2bb3b3e commit 70f58f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/config/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ var GrpcServerMaxConnectionAgeGrace = Create(&ViperConfigKey{
Key: "grpc.server.max_connection_age_grace",
})

var GrpcServerMaxMsgSize = Create(&ViperConfigKey{
Key: "grpc.server.max_msg_size",
Default: 1024 * 1024 * 11,
})

var TlsServerCertFilePaths = Create(&ViperConfigKey{
Key: "tls.server.cert_file_paths",
})
Expand Down
3 changes: 3 additions & 0 deletions internal/service/deckard_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ func NewDeckardService(qpool queue.DeckardQueue, queueConfigurationService queue

func (d *Deckard) ServeGRPCServer(ctx context.Context) (*grpc.Server, error) {
port := config.GrpcPort.GetInt()
maxMsgSize := config.GrpcServerMaxMsgSize.GetInt()

listen, err := net.Listen("tcp", fmt.Sprint(":", port))
if err != nil {
Expand All @@ -78,6 +79,8 @@ func (d *Deckard) ServeGRPCServer(ctx context.Context) (*grpc.Server, error) {
grpc.UnaryInterceptor(otelgrpc.UnaryServerInterceptor()),
grpc.StreamInterceptor(otelgrpc.StreamServerInterceptor()),
getGrpcKeepaliveParams(),
grpc.MaxRecvMsgSize(maxMsgSize),
grpc.MaxSendMsgSize(maxMsgSize),
}

credentials, err := loadTLSCredentials()
Expand Down

0 comments on commit 70f58f7

Please sign in to comment.