ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pavel Tupitsyn <ptupit...@apache.org>
Subject Thin client protocol message format
Date Tue, 01 Aug 2017 16:10:45 GMT
Igniters,

Below is a proposed design for thin client protocol [1] [2] socket data
exchange format.

* Values are little-endian
* Every request and response message starts with 4-byte length (including
handshake)
* Ignite binary format is used for value serialization (via
GridBinaryMarshaller/BinaryWriter/BinaryReader). Ignite binary protocol has
to be implemented by clients anyway to work with cache values, so it makes
sense to use for all data exchange.


1) Socket connection is established on a port according
to ConnectorConfiguration.port

2) Handshake is performed.
 Request:
   int32 length = 8     // message length
   byte opCode = 1   // handshake command
   int16 verMajor
   int16 verMinor
   int16 verMaintenance
   byte clientCode = 2    // client type code (odbc, jdbc, platform)

 Response:
   uint32 length = 1
   byte success

3) Execute command. Request starts with a command code, then goes
command-specific data.
For example, IgniteCache<Integer, String>.put(1, "foo") will look like this:
 Request:
   int16 opCode    // OP_CACHE_GET
   int32 cacheId    // GridCacheUtils.cacheId
   byte flags          // skipStore, noRetry, etc
   binobject key

 Response:
   byte success
   binobject value

Where binobject corresponds to Ignite BinaryMarshaller format, which is
produced by BinaryWriter.writeObject method. Integer will be represented as
  byte typeCode = 3  // GridBinaryMarshaller.INT
  int32 value = 1

4) Goto (3)


Comments are welcome.

Pavel

[1]
http://apache-ignite-developers.2346864.n4.nabble.com/Support-for-Ignite-clients-in-any-language-thin-client-protocol-td20297.html
[2] https://issues.apache.org/jira/browse/IGNITE-5896

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message