pulsar-client-go
pulsar-client-go copied to clipboard
client option to set DefaultMaxMessageSize
Motivation
When the broker sets maxMessageSize more than 5MB, the go client can still get error message size exceeds MaxMessageSize. Upon some conditions, the broker is not communicate the max message size in CommandConnected.MaxMessageSize. This PR will allow the client to set a non-default (5MB) message size if the MaxMessageSize is not present from the control channel.
Verifying this change
This change is a trivial rework / code cleanup without any test coverage. This change is already covered by existing tests, such as (please describe tests).
Does this pull request potentially affect one of the following parts:
If yes was chosen, please highlight the changes
- Dependencies (does it add or upgrade a dependency): (no)
- The public API: (yes)
- The schema: no
- The default values of configurations: (no)
- The wire protocol: (no)
It exposes a new configuration parameter to allow the client set the mexMessageSize
Documentation
- Does this pull request introduce a new feature? (no)
- If yes, how is the feature documented? (not applicable)
- If a feature is not applicable for documentation, explain why?
- If a feature is not documented yet in this PR, please create a followup issue for adding the documentation
Hello @zzzming , in connection struct, we have defined the maxMessageSize field and obtained the current maxMessageSize value from the broker during the handshake. Does this function not take effect?
In the original design, the value of maxMessageSize is to be obtained from the broker instead of defining the maxMessageSize of this value on the client side