Skip to content

[Issue 240] Add check for max message size - #263

Merged
wolfstudy merged 3 commits into
apache:masterfrom
izackwu:master
May 28, 2020
Merged

wolfstudy merged 3 commits into
apache:masterfrom
izackwu:master

Conversation

@izackwu

@izackwu izackwu commented May 26, 2020

Copy link
Copy Markdown
Contributor

Fixes #240

Motivation

Issue #240: Add client-side check for max message size

Modifications

  1. When creating a connection, try to get maxMessageSize from handshake
    response command. If it's not set, then use the default maxMessageSize
    value defined in the client side.

  2. When sending a message, check whether the size of payload exceeds
    maxMessageSize. If so, return error immediately without adding this
    meesage into sending queue.

  3. To implement these, I made some tiny modifications in Connection
    interface and added a field in its implementation struct.

1. When creating a connection, try to get maxMessageSize from handshake
response command. If it's not set, then use the default maxMessageSize
value defined in the client side.
2. When sending a message, check whether the size of payload exceeds
maxMessageSize. If so, return error immediately without adding this
meesage into sending queue.
3. To implement these, I made some tiny modifications in Connection
interface and added a field in its implementation struct.

@wolfstudy wolfstudy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The changes LGTM, @keithnull can you test case for this?

@wolfstudy wolfstudy added this to the 0.1.1 milestone May 26, 2020
@izackwu

izackwu commented May 26, 2020

Copy link
Copy Markdown
Contributor Author

@wolfstudy okay, I'll try to add some test cases for this change later

Comment thread pulsar/producer_partition.go Resolved
@izackwu
izackwu requested a review from wolfstudy May 27, 2020 09:44

@wolfstudy wolfstudy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The change LGTM +1

Comment thread pulsar/producer_partition.go Resolved
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.

Check max message size in go client

3 participants