You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| `request_api_key` | INT16 | The API key for the request |
162
+
| `request_api_version` | INT16 | The version of the API for the request |
163
+
| `correlation_id` | INT32 | A unique identifier for the request |
164
+
| `client_id` | NULLABLE_STRING | The client ID for the request |
171
165
172
-
In general each request in the Kafka wire protocol starts with a INT32 containing the length of the entire message, followed by the RequestHeader and then the RequestBody.
166
+
- `request_api_key`: An integer identifying the type of request.
167
+
- The value of this field is different for each type of request.
168
+
- For example, the `APIVersions` request has a `request_api_key` of `18`.
169
+
- A full list of API keys can be found in [the docs](https://kafka.apache.org/protocol.html#protocol_api_keys).
170
+
- `request_api_version`: The version of the API for the request.
171
+
- This is an integer that identifies the version of the API for the request.
172
+
- For example, the `APIVersions` request supports multiple versions: `0`, `1`, `2` and `3`.
173
+
- `correlation_id`: A unique identifier for the request.
174
+
- This value is echo-ed back in the response.
175
+
- (This is the value you hardcoded in the previous stage!)
176
+
- `client_id`: A string identifying the client that sent the request.
177
+
178
+
In this stage, you'll only need to parse the `correlation_id` field. You can ignore the other fields for now.
173
179
174
180
### Tests
175
181
@@ -179,11 +185,18 @@ stages:
179
185
$ ./your_program.sh
180
186
```
181
187
182
-
It'll then try to connect to your server on port 9092 and send a `APIVersions-V3` request. The tester will validate that the correlation ID in the response header matches
183
-
the correlation ID in the request header.
188
+
It'll then connect to your server on port 9092 and send a `APIVersions` request. The tester will include a random
189
+
correlation ID in this request.
184
190
185
-
Although your server's response will need to contain the "message length" field (an int32), the tester will not verify this value in this stage.
191
+
The tester will wait for your program to respond and it'll then validate that the correlation ID in the response header matches the correlation ID it send in the request header.
186
192
193
+
Just like the previous stage, the tester won't validate the first 4 bytes of your response (the "message length") in this stage.
194
+
195
+
### Notes
196
+
197
+
- You can remove the hardcoded correlation ID of `7` we used in the previous stage. You can now read this value from the request.
198
+
- Since the response format is currently incomplete, the first 4 bytes of your response (the "message length") will not be validated in this stage. We'll get to this in later stages.
199
+
- You don't need to parse all fields in the request in this stage, just the `correlation_id` field. We'll get to the other fields in later stages.
187
200
marketing_md: |-
188
201
In this stage, you'll start decoding the RequestHeader.
0 commit comments