Skip to content

client option to set DefaultMaxMessageSize #699

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zzzming
Copy link
Contributor

@zzzming zzzming commented Jan 5, 2022

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

@@ -46,6 +46,7 @@ type connectionPool struct {
maxConnectionsPerHost int32
roundRobinCnt int32
metrics *Metrics
defaultMaxMessageSize int
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest making this an int32 to be consistent with the type of connection.defaultMaxMessageSize.

@wolfstudy wolfstudy added this to the v0.8.0 milestone Jan 6, 2022
@wolfstudy
Copy link
Member

wolfstudy commented Jan 6, 2022

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

@wolfstudy wolfstudy modified the milestones: v0.8.0, 0.9.0 Feb 16, 2022
@freeznet freeznet modified the milestones: v0.9.0, v0.10.0 Jul 4, 2022
@RobertIndie RobertIndie modified the milestones: v0.10.0, v0.11.0 Mar 27, 2023
@RobertIndie RobertIndie modified the milestones: v0.11.0, v0.12.0 Jul 4, 2023
@RobertIndie RobertIndie modified the milestones: v0.12.0, v0.13.0 Jan 10, 2024
@RobertIndie RobertIndie modified the milestones: v0.13.0, v0.14.0 Jul 15, 2024
@RobertIndie RobertIndie modified the milestones: v0.14.0, v0.15.0 Oct 8, 2024
@RobertIndie RobertIndie modified the milestones: v0.15.0, v0.16.0 May 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants