You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by si...@apache.org on 2019/05/09 02:48:08 UTC

[pulsar.wiki] branch master updated: Created PIP 36: Max Message Size (markdown)

This is an automated email from the ASF dual-hosted git repository.

sijie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.wiki.git


The following commit(s) were added to refs/heads/master by this push:
     new de64205  Created PIP 36: Max Message Size (markdown)
de64205 is described below

commit de642057212cdb7fe9a004ffa5a070831fc997fc
Author: Sijie Guo <gu...@gmail.com>
AuthorDate: Thu May 9 10:48:07 2019 +0800

    Created PIP 36: Max Message Size (markdown)
---
 PIP-36:-Max-Message-Size.md | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/PIP-36:-Max-Message-Size.md b/PIP-36:-Max-Message-Size.md
new file mode 100644
index 0000000..43f851b
--- /dev/null
+++ b/PIP-36:-Max-Message-Size.md
@@ -0,0 +1,42 @@
+# PIP 36: Max Message Size
+
+- Status: Proposed
+- Author: Yong Zhang
+- Discusstion Thread:
+- Issue: 
+
+## Motivation
+
+Currently `MaxMessageSize` is hardcoded in Pulsar and it can’t be modified in server configuration. So there is no way when user want to modify the limit to transfer larger size message. 
+Hence we add a `MaxMessageSize` config in `broker.conf` to solve this problem. Because broker server will decide how much message size will be received so client need know how much message client can be sent. 
+
+Hence we propose adding a new flag `max_message_size` in protocol to tell a client what is the max message size that it can use once it connected.
+
+## Changes
+### Wire Protocol
+We propose to introduce an optional field called `max_message_size` in `CommandConnected` .
+```
+message CommandConnected {
+	required string server_version = 1;
+	optional int32 protocol_version = 2 [default = 0];
+
+	// used for telling clients what is the max message size it can use
+	optional int64 max_message_size = 3 [default = 5 * 1024 * 1024];
+}
+
+```
+
+On server side, we need send `max_message_size` to clients when broker complete connect:
+```
+// complete the connect and sent newConnected command
+private void completeConnect(int clientProtoVersion, String clientVersion, long maxMessageSize) {
+    ctx.writeAndFlush(Commands.newConnected(clientProtoVersion, maxMessageSize));
+    state = State.Connected;
+    remoteEndpointProtocolVersion = clientProtoVersion;
+    if (isNotBlank(clientVersion) && !clientVersion.contains(" ") /* ignore default version: pulsar client */) {
+        this.clientVersion = clientVersion.intern();
+    }
+}
+```
+
+On client side, client should set max message size in configuration and it should be smaller than server support.