You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by pe...@apache.org on 2022/06/06 08:11:05 UTC

[pulsar] branch master updated: [fix][doc] Fixed binary protocol naming and descriptions (#15878)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 97ad60a7aca [fix][doc] Fixed binary protocol naming and descriptions (#15878)
97ad60a7aca is described below

commit 97ad60a7acac51f0f964f12a50118ea70f7486bc
Author: Asaf Mesika <as...@gmail.com>
AuthorDate: Mon Jun 6 11:10:56 2022 +0300

    [fix][doc] Fixed binary protocol naming and descriptions (#15878)
---
 site2/docs/developing-binary-protocol.md | 50 ++++++++++++++++----------------
 1 file changed, 25 insertions(+), 25 deletions(-)

diff --git a/site2/docs/developing-binary-protocol.md b/site2/docs/developing-binary-protocol.md
index d571e976b21..2d085254016 100644
--- a/site2/docs/developing-binary-protocol.md
+++ b/site2/docs/developing-binary-protocol.md
@@ -28,39 +28,39 @@ The Pulsar protocol allows for two types of commands:
 
 Simple (payload-free) commands have this basic structure:
 
-| Component     | Description                                                                             | Size (in bytes) |
-|:--------------|:----------------------------------------------------------------------------------------|:----------------|
-| `totalSize`   | The size of the frame, counting everything that comes after it (in bytes)               | 4               |
-| `commandSize` | The size of the protobuf-serialized command                                             | 4               |
-| `message`     | The protobuf message serialized in a raw binary format (rather than in protobuf format) |                 |
+| Component     | Description                                                               | Size (in bytes) |
+|:--------------|:--------------------------------------------------------------------------|:----------------|
+| `totalSize`   | The size of the frame, counting everything that comes after it (in bytes) | 4               |
+| `commandSize` | The size of the protobuf-serialized command                               | 4               |
+| `command`     | The protobuf serialized command                                           |                 |
 
-### Payload commands
+### Message commands
 
 Payload commands have this basic structure:
 
-| Component                          | Required or optional| Description                                                                                 | Size (in bytes) |
-|:-----------------------------------|:----------|:--------------------------------------------------------------------------------------------|:----------------|
-| `totalSize`                        | Required  | The size of the frame, counting everything that comes after it (in bytes)                   | 4               |
-| `commandSize`                      | Required  | The size of the protobuf-serialized command                                                 | 4               |
-| `message`                          | Required  | The protobuf message serialized in a raw binary format (rather than in protobuf format)     |                 |
-| `magicNumberOfBrokerEntryMetadata` | Optional  | A 2-byte byte array (`0x0e02`) identifying the broker entry metadata   <br /> **Note**: `magicNumberOfBrokerEntryMetadata` , `brokerEntryMetadataSize`, and `brokerEntryMetadata` should be used **together**.                     | 2               |
-| `brokerEntryMetadataSize`          | Optional  | The size of the broker entry metadata                                                       | 4               |
-| `brokerEntryMetadata`              | Optional  | The broker entry metadata stored as a binary protobuf message                               |                 |
-| `magicNumber`                      | Required  | A 2-byte byte array (`0x0e01`) identifying the current format                               | 2               |
-| `checksum`                         | Required  | A [CRC32-C checksum](http://www.evanjones.ca/crc32c.html) of everything that comes after it | 4               |
-| `metadataSize`                     | Required  | The size of the message [metadata](#message-metadata)                                       | 4               |
-| `metadata`                         | Required  | The message [metadata](#message-metadata) stored as a binary protobuf message               |                 |
-| `payload`                          | Required  | Anything left in the frame is considered the payload and can include any sequence of bytes  |                 |
+| Component                          | Required or optional | Description                                                                                                                                                                                                    | Size (in bytes) |
+|:-----------------------------------|:---------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:----------------|
+| `totalSize`                        | Required             | The size of the frame, counting everything that comes after it (in bytes)                                                                                                                                      | 4               |
+| `commandSize`                      | Required             | The size of the protobuf-serialized command                                                                                                                                                                    | 4               |
+| `command`                          | Required             | The protobuf serialized command                                                                                                                                                                                |                 |
+| `magicNumberOfBrokerEntryMetadata` | Optional             | A 2-byte byte array (`0x0e02`) identifying the broker entry metadata   <br /> **Note**: `magicNumberOfBrokerEntryMetadata` , `brokerEntryMetadataSize`, and `brokerEntryMetadata` should be used **together**. | 2               |
+| `brokerEntryMetadataSize`          | Optional             | The size of the broker entry metadata                                                                                                                                                                          | 4               |
+| `brokerEntryMetadata`              | Optional             | The broker entry metadata stored as a binary protobuf message                                                                                                                                                  |                 |
+| `magicNumber`                      | Required             | A 2-byte byte array (`0x0e01`) identifying the current format                                                                                                                                                  | 2               |
+| `checksum`                         | Required             | A [CRC32-C checksum](http://www.evanjones.ca/crc32c.html) of everything that comes after it                                                                                                                    | 4               |
+| `metadataSize`                     | Required             | The size of the message [metadata](#message-metadata)                                                                                                                                                          | 4               |
+| `metadata`                         | Required             | The message [metadata](#message-metadata) stored as a binary protobuf message                                                                                                                                  |                 |
+| `payload`                          | Required             | Anything left in the frame is considered the payload and can include any sequence of bytes                                                                                                                     |                 |
 
 ## Broker entry metadata
 
 Broker entry metadata is stored alongside the message metadata as a serialized protobuf message.
 It is created by the broker when the message arrived at the broker and passed without changes to the consumer if configured.
 
-| Field              | Required or optional       | Description                                                                                                                   |
-|:-------------------|:----------------|:------------------------------------------------------------------------------------------------------------------------------|
-| `broker_timestamp` | Optional        | The timestamp when a message arrived at the broker (`id est` as the number of milliseconds since January 1st, 1970 in UTC)      |
-| `index`            | Optional        | The index of the message. It is assigned by the broker.
+| Field              | Required or optional | Description                                                                                                                |
+|:-------------------|:---------------------|:---------------------------------------------------------------------------------------------------------------------------|
+| `broker_timestamp` | Optional             | The timestamp when a message arrived at the broker (`id est` as the number of milliseconds since January 1st, 1970 in UTC) |
+| `index`            | Optional             | The index of the message. It is assigned by the broker.                                                                    |
 
 If you want to use broker entry metadata for **brokers**, configure the [`brokerEntryMetadataInterceptors`](reference-configuration.md#broker) parameter in the `broker.conf` file.
 
@@ -246,7 +246,7 @@ Command `Send` is used to publish a new message within the context of an
 already existing producer. If a producer has not yet been created for the
 connection, the broker will terminate the connection. This command is used
 in a frame that includes command as well as message payload, for which the
-complete format is specified in the [payload commands](#payload-commands) section.
+complete format is specified in the [message commands](#message-commands) section.
 
 ```protobuf
 
@@ -399,7 +399,7 @@ within the limits of the given permits.
 
 
 This command is used in a frame that includes the message payload as well, for
-which the complete format is specified in the [payload commands](#payload-commands)
+which the complete format is specified in the [message commands](#message-commands)
 section.
 
 ```protobuf