Skip to end of metadata
Go to start of metadata


Message Definition

A message is a series of bytes which contains the request or response. If the message is large, then we will have provision to divide the message into small messages. In that case, client/server needs to collect all messages to parse the request/response.

The message will be sent in following way.  A client can send the multiple messages on the connection and the server will respond to those messages in same order. 

Additional Request and Response message definitions can be found in the API's section.

Message definition grammar

In order to consistently define messages the Extended Backus–Naur form grammar will be used.

Usage
Notation
definition=
alteration|
optional[ ... ]
repetition{ ... }
Grouping( ... )

Generic Message definition

Every message (except for connection initializing handshakes, which are necessarily insulated from future changes to the message structure) will adhere to the following generic message definition. A Message will comprise of either a Request or Response component.

Message = (Request Response)Description
Requesttype = RequestThis field will contain the Request component.
Response

type = Response

 

This field will contain the Response component.


Request

The request will contain an operation specific request structure. 

Request = RequestAPI
 Notes
Description

RequestAPI

type = variable

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

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

Response

The response contains the response object corresponding to the request, or an error response object.

Response = APIResponse

Description
APIResponsetype = variable

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

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

ErrorResponse

The server will raise an error when it failed to execute API request from the client. The error response wraps an error object detailing the failure.

ErrorResponse = ErrorDescription
errortype = ErrorThe error message

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

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
intResult32-bit signed integer
longResult64-bit signed integer
shortResult16-bit signed integer
byteResult8-bit signed integer
booleanResultTrue or False.
doubleResult64-bit floating point number.
floatResult32-bit floating point number.
binaryResultA binary blob to be stored in the region.
stringResultCharacter string
customEncodedValueData which doesn't use protobuf serialization

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 valueDescription
encodingTypetype = EncodingTypeThe encoding type of the following bytes.
valuetype = bytesSerialized Value Object which Geode can understand

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.

Entry

This structure represents a pair of data corresponding to a key and associated value.

Entry = EncodedValue ErrorDescription
keytype = EncodedValueData referencing the corresponding value
valuetype = EncodedValueData associated to the corresponding key

KeyedError

Some responses may contain multiple errors keyed to different inputs.  This object enables this behavior.

KeyedError = EncodedValue ErrorDescription
keytype = EncodedValueKey corresponding to this error
errortype = ErrorDetails about the failure

Request and Response Definitions

The request and response messages are further broken down by category and can be found on the following pages.

Connection API

Initial operations for correctly setting up a connection can be found here

Region API

Operations for getting, creating, and modifying data regions can be found here

Locator API

Connections to locators behave a bit differently from normal cache server connections.  For more details and information about locator operations, visit this page.

 

  • No labels