...
Protocol Terms
Any binary protocol requires the following things:
Version: This indicates the API version.
Correlation Id: This helps to relate the request-should be different per request sent. It allows correlation of request and response.
Object Type: What is the The type of a serialized object.
Response Type: It indicates whether a response is partial or complete.
ErrorCodes: It indicates the problem with API invocation.
Chunk Response: Send large response in multiple chunks.
Continuous Response: Client can register(Observer pattern) for events and then server notify the client if those events occur.
Request: It indicates client's message
Response: It indicates server's message.
Request Format: Format of request api and its parameters, which client wants to invoke.
Response Format: Format for api return value, which client invoked.
Message: Set of bytes which contain the Message Header and Request/Response.
Serialized Byte Order: Big Endian
...
Type | Number Of Bytes | Value | SerializedBytes |
---|---|---|---|
boolean | Fixed = 1 | true | 0x01 |
boolean | Fixed = 1 | false | 0x00 |
int8 | Fixed = 1 | 1 | 0x01 |
int16 | Fixed = 2 | 1 | 0x00 0x01 |
int32 | Fixed = 4 | 1 | 0x00 0x00 0x00 0x01 |
int64 | Fixed = 8 | 1 | 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01 |
String(modified UTF 8 ) | Variable
| "Geode" | 0x00 0x05 (length) 0x47 0x65 0x6f 0x64 0x65 (utf encoding) |
byte[] | Variable
| {1,2} | 0x00 0x02 (length) 0x01 0x02 |
bytes | Variable: series of bytes which contains all themeta info to create the java objectcontaining a serialized value. |
Message(Framing)
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.
...
PutResponse => Success |
---|
Success => fixedSize = 1 byte, type = boolean |
GetRequest
GetRequest --=> RegionName Key CallbackArg |
---|
RegionName => (variable size, type = String) |
Key => bytes |
CallbackArg => bytes |
...
GetAllResponse
GetAllResponse --=> NumberOfKeyValuePair Key value {Key value} |
---|
NumberOfKeyValuePair => fixedSize = 4 bytes, type = int32 |
Key => bytes |
value => bytes |
...
ClientConfigRequest | NumberOfProperties PropertyId PropertyValue{ PropertyId PropertyValue} |
---|---|
NumberOfProperties | fixedSize = 2 bytes, type = int16 |
Propertyid | fixedSize = 2 bytes, type = int16 |
PropertyValue | variable, Value as defined in table below |
ClientConfigResponse –-==> Success |
---|
Success => fixedSize = 1 byte, type = boolean |
...
AuthRequest | isDiffieHellmanEnabled ( NumberOfProperties PropertyId PropertyValue{ PropertyId PropertyValue} | NumberOfEncryptedBytes EncryptedCredentials ) |
---|---|
isDiffieHellmanEnabled | fixedSize = 1 byte, type = boolean |
NumberOfProperties | fixedSize = 2 bytes, type = int16 |
Propertyid | bytes |
PropertyValue | bytes |
EncrptedCredentials | bytes |
AuthResponse –-=> Success |
---|
Success => fixedSize = 1 byte, type = boolean |
...