Versions Compared

Key

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

...

Every message will adhere to the following generic message definition. A Message will comprise of a MessageHeader and either a Request or Response component.

Message = MessageHeader (Request Response)Description
MessageHeadertype = MessageHeaderThe MessageHeader corresponding to this Message.
Requesttype = RequestThis field will contain the Request component.
Response

type = Response

 

This field will contain the Response component.


Anchor

...

  • If a message is sent in multiple sub-messages, then it will be used for combining the whole message. 
  • It will be used for correlating the request to its response.
MessageHeader = Size CorrelationId isPartialMessage hasMetaDataDescription
Sizetype = int32Size of request or response (not including this header)
CorrelationIdtype = int32The correlationID used to match a request to its corresponding response. This will be important if/when we allow for out-of-order messages in the future.
isPartialMessagetype = booleanIs this a partial message? The exact semantics of partial messages is to be determined.

Anchor
Request
Request
Request

The request contains optional metadata and the will contain an operation specific request structure itself

This field is optional and will be populated if the MessageHeader.hasMeta is true
Request = [MetaData] RequestAPI
 Notes
Description
MetaDataoptional, type = MetaData

RequestAPI

type = variable

The specific Request message. Here are some examples of Request messages.

PutRequest | GetRequest | PutAllRequest | GetAllRequest |ServerConfigRequest | ClientConfigRequest | AuthRequest

Anchor
Response
Response
Response

The response contains optional metadata and the return valuethe response object corresponding to the request, or an error response object.

optional, type = MetaData

Response = [MetaData] APIResponse

Description
MetaData
This field is optional and will be populated if the MessageHeader.hasMeta is trueAPIResponsetype = variable

The Api specific Reponse message. Here are some examples of Response messages

PutResponse GetResponse | PutAllResponse | GetAllResponse | ServerConfigResposne | ClientConfigResponse | AuthResponse | ErrorResponse

Anchor
ErrorResponse
ErrorResponse
ErrorResponse

The server will raise the an error when it failed to execute API request from the client. The error code and message should help the client to diagnose the issueerror response wraps an error object detailing the failure.

ErrorResponse = errorMessageErrorDescription
errorMessageerrortype = String ErrorThe error message

Anchor

...

ErrorBasicType

...

ErrorBasicType

...

EncodedValue represents a serialized value in a format that Geode can understand. It is used for both keys and values in database requests.

Value = {ValueHeader value}Description
encodingTypetype = int8 (encoding type)The encoding type of the following bytes.
valuetype = bytesSerialized Value Object which Geode can understand

...

Error

The server will raise the error when it failed to execute API request from the client. The error code and message should help the client to diagnose the issue.

ErrorResponse = errorCode messageDescription
errorCodetype = intNumeric code referencing the type of failure
messagetype = StringThe error message

Anchor
Value
Value
EncodedValue

Some data being sent between the client and server, for the most part these rely on protobuf for proper serialization, except for CustomEncodedValues

EncodedValue = (one of the below)Description
intResult

Currently supported types are:

NameDescription
Int32-bit signed integer, big-endian encoded
LonglongResult64-bit signed integer, big-endian encoded
ShortshortResult16-bit signed integer, big-endian encoded
BytebyteResult8-bit signed integer, big-endian encoded
BooleanbooleanResultTrue or False.
doubleResult64-bit floating point number.
StringfloatResultUTF-8 encoded string. (whether it can contain nulls is TBD)32-bit floating point number.
binaryResultBinaryA binary blob to be stored in the region.
JSONUTF-8 encoded string, containing a JSON document that will be deserialized in the same way as the REST API.
Float32-bit floating point number.
Double64-bit floating point number.

 

...

stringResultCharacter string
customEncodedValueData which doesn't use protobuf serialization

Anchor
CustomEncodedValue
CustomEncodedValue
CustomEncodedValue

EncodedValue represents a serialized value in a format that Geode can understand. It is used for both keys and values in database requests.

Value = {ValueHeader value}Description
encodingTypetype = EncodingTypeThe encoding type of the following bytes.
valuetype = bytesSerialized Value Object which Geode can understand

Anchor
EncodingTypes
EncodingTypes
EncodingType

Currently supported types are:

NameDescription
JSONUTF-8 encoded string, containing a JSON document that will be deserialized in the same way as the REST API

...

The purpose of a metadata to pass defined key value pair with request and response. That will be optional for a client. If there is any metadata associated with request or response, then need to set "hasMetadata" flag to "true" in request or response header. After that send metadata in the following format.

MetaData = NumberOfMetadata { MetadataKeyId MetadataKeyValue} Description
NumberOfMetadatatype = int16The number of MetaDataKeyId : MetaDataKeyValue combinations
MetadataKeyIdtype = int16Supported MetaDataKeyId's can be found in the table "Supported MetaData - MetaData KeyId"
MetadataKeyValuetype = variableThe MetaData value for the KeyId. The supported dataType can be found in the table "Supported MetaData - MetaData Value Type"

Supported MetaData

 We would have following pre-defined key and value for a metadata. Note this list will grow over time.

MetaData for Requests

Request MetaData Key
MetaData KeyId
MetaData Value example
MetaData Value Type
Description
JSON_KEY

1

true

type = boolean

Geode will expect key as JSON string(or bytes) and it will convert that string into PDX key.

If the response requires a key, then it will convert the PDX key to JSON string(or bytes) back.

JSON_VALUE

2

 

true

type = boolean

Geode will expect Value as JSON string(or bytes) and it will convert that string into PDX value.

If the response requires a value, then it will convert PDX value to JSON string(or bytes) back.

EVENT_ID

3

 

EventId {

uniqueId: type = String

ThreadId:type=int64

SequenceId: type=int64

}

type = bytes

The eventid is used to identify same region event in Geode. Geode keeps map of "uniqueId + threadId" Vs

"SequenceId" to know whether region event has been already seen or not.

 

MetaData for Responses

[optional]The server accepted and forwarded the request to the appropriate

node holding the affected cache entry.  A smart client should refresh its partitioned

region location metadata for higher performance
Response MetaData Key
MetaData KeyId
MetaData Value example
MetaData Value Type
Description
UPDATE_PR_META_DATA

1

true

type = boolean

.