Skip to content

feat: honor the broker's announced maximum message size - #434

Open
glebpom wants to merge 2 commits into
streamnative:masterfrom
nervix-io:nervix-max-message-size
Open

glebpom wants to merge 2 commits into
streamnative:masterfrom
nervix-io:nervix-max-message-size

Conversation

@glebpom

@glebpom glebpom commented Oct 9, 2026

Copy link
Copy Markdown

No description provided.

streamnativebot and others added 2 commits August 24, 2026 23:54
The broker announces its maxMessageSize in CommandConnected, which the client discarded. A message above it reached the broker, whose frame decoder closes the connection on a frame larger than the limit plus 10 KiB of padding, failing every request in flight on the connection with Disconnected.

Keep the announced value per connection, expose it as ConnectionSender::max_message_size, and refuse a message whose serialized metadata and payload exceed it with ConnectionError::MessageTooLarge before it is written, the size the Java client checks. A connection whose broker announced no maximum sends any message.

A broker SendError, such as NotAllowedError for a message above a topic's maxMessageSize policy, now resolves the send with ConnectionError::PulsarError carrying the server error and its message, instead of UnexpectedResponse with the command's debug output.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.

2 participants