Download Riak 2.0 Beta 1

PBC Get Client ID

Get the client id used for this connection. Client ids are used for conflict resolution and each unique actor in the system should be assigned one. A client id is assigned randomly when the socket is connected and can be changed using Set Client ID.

Client IDs in 1.0

All requests to Riak <1.0 or Riak 1.0 without vnode_vclocks enabled should set the Client ID, which can be any string that uniquely identifies the client, for purposes of tracing object modifications in the vector clock.

Request

Just the RpbGetClientIdReq message code. No request message defined.

Response

// Get ClientId Request - no message defined, just send RpbGetClientIdReq
message code
message RpbGetClientIdResp {
    required bytes client_id = 1; // Client id in use for this connection
}

Example

Request

Hex     00 00 00 01 03
Erlang  <<0,0,0,1,3>>

Response

Hex     00 00 00 07 04 0A 04 01 65 01 B5
Erlang <<0,0,0,7,4,10,4,1,101,1,181>>

RpbGetClientIdResp protoc decode:
client_id: "001e001265"