|
| 1 | +In this stage, you'll add support for producing to multiple topics in a single request. |
| 2 | + |
| 3 | +## Cross-Topic Production |
| 4 | + |
| 5 | +Your Kafka implementation should handle complex requests with multiple topics, manage independent offset tracking per topic and partition, and handle complex response structures. Each topic maintains completely independent offset sequences. |
| 6 | + |
| 7 | +## Tests |
| 8 | + |
| 9 | +The tester will execute your program like this: |
| 10 | + |
| 11 | +```bash |
| 12 | +./your_program.sh /tmp/server.properties |
| 13 | +``` |
| 14 | + |
| 15 | +It'll then connect to your server on port 9092 and send a `Produce` (v11) request targeting multiple topics with their respective partitions. |
| 16 | + |
| 17 | +The tester will validate that: |
| 18 | + |
| 19 | +- The first 4 bytes of your response (the "message length") are valid. |
| 20 | +- The correlation ID in the response header matches the correlation ID in the request header. |
| 21 | +- The error code in the response body is `0` (NO_ERROR). |
| 22 | +- The `throttle_time_ms` field in the response is `0`. |
| 23 | +- Each topic in the request has a corresponding topic response. |
| 24 | +- Each topic response contains: |
| 25 | + - The correct `name` field matching the topic name in the request. |
| 26 | + - Each partition in the request has a corresponding partition response. |
| 27 | + - Each partition response contains: |
| 28 | + - The correct `partition` field matching the request. |
| 29 | + - An error code of `0` (NO_ERROR). |
| 30 | + - A valid `offset` field with the assigned offset for that topic-partition. |
| 31 | + - A valid `timestamp` field. |
| 32 | + - A correct `log_start_offset` field. |
| 33 | +- Records are persisted to the correct topic-partition log files. |
| 34 | +- Offset assignment is independent per topic-partition combination. |
| 35 | + |
| 36 | +## Notes |
| 37 | + |
| 38 | +- Each topic-partition combination maintains its own independent offset sequence. |
| 39 | +- Multiple topics can be written to simultaneously in a single request. |
| 40 | +- The response structure is nested: topics contain partition responses. |
| 41 | +- Topic-level and partition-level errors should be handled independently. |
| 42 | +- This is the most complex produce scenario, combining multi-topic and multi-partition handling. |
| 43 | +- The official docs for the `Produce` request can be found [here](https://kafka.apache.org/protocol.html#The_Messages_Produce). |
0 commit comments