SaslHandshake
This page encodes the smallest legal instance of the request and the response: numeric fields are zero, strings and byte arrays are empty, every array carries exactly one sample element, and any records field holds one empty 61-byte RecordBatch v2. Version 1 predates flexible versions, so lengths are fixed-width int16 and int32 prefixes and there are no tagged-field trailers. Sizes below include the leading int32 size prefix.
- API key
- 17
- Encoded at
- v1
- Flexible versions
- none
- Headers
- req v1, resp v0
- Request versions
- 0-1
- Response versions
- 0-1
- Request size
- 16 bytes
- Response size
- 16 bytes
framerpc headerrequest bodyRecordBatchRecordresponse bodytagged_fields
Request
SaslHandshakeRequest v1, request header v1, 16 bytes on the wire
byte layout (16 bytes, 16 bytes per row)
0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
0000
object tree
SaslHandshakeRequest message v1 [0x0000, 16B] +-- Frame [0x0000, 4B] length-delimited framing | +-- size int32 = 12 [0x0000, 4B] number of bytes that follow, patched after encoding +-- RequestHeader v1 [0x0004, 10B] common request header | +-- request_api_key int16 = 17 (SaslHandshake) [0x0004, 2B] numeric id of the API being invoked | +-- request_api_version int16 = 1 [0x0006, 2B] version of the API being invoked | +-- correlation_id int32 = 0 [0x0008, 4B] echoed back by the broker in the response | +-- client_id nullable_string = "" (int16 len=0) [0x000c, 2B] always a non-flexible int16-prefixed string +-- SaslHandshakeRequest struct [0x000e, 2B] message body, version 1 +-- Mechanism string = "" (int16 len=0) [0x000e, 2B] The SASL mechanism chosen by the client.
kafka message schema (.json)
{ "apiKey": 17, "type": "request", "listeners": ["broker", "controller"], "name": "SaslHandshakeRequest", // Version 1 supports SASL_AUTHENTICATE. // NOTE: Version cannot be easily bumped due to incorrect // client negotiation for clients <= 2.4. // See https://issues.apache.org/jira/browse/KAFKA-9577 "validVersions": "0-1", "flexibleVersions": "none", "fields": [ { "name": "Mechanism", "type": "string", "versions": "0+", "about": "The SASL mechanism chosen by the client." } ] }
Response
SaslHandshakeResponse v1, response header v0, 16 bytes on the wire
byte layout (16 bytes, 16 bytes per row)
0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
0000
object tree
SaslHandshakeResponse message v1 [0x0000, 16B] +-- Frame [0x0000, 4B] length-delimited framing | +-- size int32 = 12 [0x0000, 4B] number of bytes that follow, patched after encoding +-- ResponseHeader v0 [0x0004, 4B] common response header | +-- correlation_id int32 = 0 [0x0004, 4B] matches the correlation_id of the request +-- SaslHandshakeResponse struct [0x0008, 8B] message body, version 1 +-- ErrorCode int16 = 0 [0x0008, 2B] The error code, or 0 if there was no error. +-- Mechanisms []string = 1 element [0x000a, 6B] The mechanisms enabled in the server. +-- length int32 = 1 [0x000a, 4B] one sample element follows +-- string[0] string = "" (int16 len=0) [0x000e, 2B]
kafka message schema (.json)
{ "apiKey": 17, "type": "response", "name": "SaslHandshakeResponse", // Version 1 is the same as version 0. // NOTE: Version cannot be easily bumped due to incorrect // client negotiation for clients <= 2.4. // See https://issues.apache.org/jira/browse/KAFKA-9577 "validVersions": "0-1", "flexibleVersions": "none", "fields": [ { "name": "ErrorCode", "type": "int16", "versions": "0+", "about": "The error code, or 0 if there was no error." }, { "name": "Mechanisms", "type": "[]string", "versions": "0+", "about": "The mechanisms enabled in the server." } ] }