This is an automated email from the ASF dual-hosted git repository.
lizhimin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-clients.git
The following commit(s) were added to refs/heads/master by this push:
new d581a03c [Golang] fix(conn): add max receive message size
configuration option (#1219)
d581a03c is described below
commit d581a03cfa6db9c056eb5da85657a9f1dc082427
Author: Quan <[email protected]>
AuthorDate: Wed Apr 15 09:45:33 2026 +0800
[Golang] fix(conn): add max receive message size configuration option
(#1219)
Added configuration for maximum receive message size in connection options,
allowing users to customize the maximum message size for gRPC calls.
Change-Id: Ia3cd5534cc97f86045ef7b04f8282848fa3ddd84
---
golang/conn.go | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/golang/conn.go b/golang/conn.go
index 0bcd8b5a..2656e68a 100644
--- a/golang/conn.go
+++ b/golang/conn.go
@@ -21,6 +21,7 @@ import (
"context"
"errors"
"fmt"
+
"github.com/apache/rocketmq-clients/golang/v5/pkg/utils"
"github.com/apache/rocketmq-clients/golang/v5/pkg/grpc/middleware/zaplog"
@@ -131,6 +132,13 @@ func (c *clientConn) dial(target string, dopts
...grpc.DialOption) (*grpc.Client
return nil, fmt.Errorf("failed to configure dialer: %v", err)
}
opts = append(opts, c.opts.DialOptions...)
+
+ if c.opts.MaxCallRecvMsgSize > 0 {
+ opts = append(opts, grpc.WithDefaultCallOptions(
+ grpc.MaxCallRecvMsgSize(c.opts.MaxCallRecvMsgSize),
+ ))
+ }
+
dctx := c.ctx
if c.opts.DialTimeout > 0 {
dctx, _ = context.WithTimeout(c.ctx, c.opts.DialTimeout)