Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

A message is series of bytes which contains request or response. If the message is large, then we need will have provision to divide the message into small messages. Then The message can will be sent in following way.

Message --> MessageHeader (Request | Response)
MessageHeader --> defined below
Request --> defined below
Response --> defined below

 

MessageHeader

The Message header is a fixed size header which contains the size of a message, boolean flag to indicates whether a message is partial, and correlation id for that request message. The correlation id is used for the dual purpose here.

  • If a message is sent in multiple sub-messages then it will be used for combining the whole message. 
  • The Client would use correlation id to match the response to its request as well.
MessageHeader --> Size PartialMessage CorrelationId
Size --> int32 (Size of request or response)
PartialMessage --> boolean (isMessageCompleted)
CorrelationId -->int32( to co-relate request and response)

 

...


Request Format

The request would contain the fixed size request header, optional metadata and Request api parameters. The request header will have requestType, apiVersion, and hasMetaData flag to indicate whether the request contains some metadata.

Request --> RequestType apiVersion hasMetaData [MetaData] RequestAPI
RequestType --> RequestTypeIdversion
apiVersion --> int16 (api version)fixedSize = 2 bytes, type = int16, sdhjk
hasMetaData --> boolean (if there is any meta data associated with this request)
MetaData --> optional

RequestAPI --> (PutRequest | GetRequest | PutAllRequest | GetAllRequest)

...