Question about stage EG2 - Fetch Single message from Disk

I keep getting this error - what is that I am doing wrong?

[tester::#EG2] [client] Hexdump of received “Fetch” response:
[tester::#EG2] [client] Idx | Hex | ASCII
[tester::#EG2] [client] -----±------------------------------------------------±----------------
[tester::#EG2] [client] 0000 | 00 00 00 91 29 fa 4f 2a 00 00 00 00 00 00 00 00 | …).O*…
[tester::#EG2] [client] 0010 | 00 00 00 02 71 a5 9a 51 89 68 4f 8b 93 7e c5 2d | …q..Q.hO..~.-
[tester::#EG2] [client] 0020 | 86 e0 e4 56 02 00 00 00 00 00 00 00 00 00 00 00 | …V…
[tester::#EG2] [client] 0030 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | …
[tester::#EG2] [client] 0040 | 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 | …
[tester::#EG2] [client] 0050 | 00 00 00 00 3d 00 00 00 00 02 56 5c 25 ed 00 00 | …=…V%…
[tester::#EG2] [client] 0060 | 00 00 00 00 00 00 01 91 e0 5b 6d 8b 00 00 01 91 | …[m…
[tester::#EG2] [client] 0070 | e0 5b 6d 8b 00 00 00 00 00 00 00 00 00 00 00 00 | .[m…
[tester::#EG2] [client] 0080 | 00 00 00 00 00 01 16 00 00 00 01 0a 61 70 70 6c | …appl
[tester::#EG2] [client] 0090 | 65 01 00 00 00 | e…
[tester::#EG2] [client]
[tester::#EG2] [Decoder] - FetchResponse
[tester::#EG2] [Decoder] - Header
[tester::#EG2] [Decoder] - CorrelationID (704270122)
[tester::#EG2] [Decoder] - Body
[tester::#EG2] [Decoder] - ThrottleTimeMS (0)
[tester::#EG2] [Decoder] - ErrorCode (0)
[tester::#EG2] [Decoder] - SessionID (0)
[tester::#EG2] [Decoder] - Topics
[tester::#EG2] [Decoder] - Length (2 (Array length(1) + 1))
[tester::#EG2] [Decoder] - Topics[0]
[tester::#EG2] [Decoder] - UUID (71a59a51-8968-4f8b-937e-c52d86e0e456)
[tester::#EG2] [Decoder] - Partitions
[tester::#EG2] [Decoder] - Length (2 (Array length(1) + 1))
[tester::#EG2] [Decoder] - Partitions[0]
[tester::#EG2] [Decoder] - Id (0)
[tester::#EG2] [Decoder] - ErrorCode (0)
[tester::#EG2] [Decoder] - HighWaterMark (0)
[tester::#EG2] [Decoder] - LastStableOffset (0)
[tester::#EG2] [Decoder] - LogStartOffset (0)
[tester::#EG2] [Decoder] - AbortedTransactions
[tester::#EG2] [Decoder] - Length (0 (Null array))
[tester::#EG2] [Decoder] - PreferredReadReplica (0)
[tester::#EG2] [Decoder] - RecordBatches
[tester::#EG2] [Decoder] - Size (2 (Record size(1) + 1))
[tester::#EG2] [Decoder] - RecordBatches[0]
[tester::#EG2] [Decoder] - Offset (0)
[tester::#EG2] [Decoder] - Length (61)
[tester::#EG2] [Decoder] - PartitionLeaderEpoch (0)
[tester::#EG2] [Decoder] - MagicByte (2)
[tester::#EG2] [Decoder] - CRC (1448879597)
[tester::#EG2] [Decoder] - Attributes (0)
[tester::#EG2] [Decoder] - LastOffsetDelta (0)
[tester::#EG2] [Decoder] - FirstTimeStamp (1726045973899)
[tester::#EG2] [Decoder] - MaxTimeStamp (1726045973899)
[tester::#EG2] [Decoder] - ProducerID (0)
[tester::#EG2] [Decoder] - ProducerEpoch (0)
[tester::#EG2] [Decoder] - BaseSequence (0)
[tester::#EG2] [Decoder] - Records
[tester::#EG2] [Decoder] - Length (1)
[tester::#EG2] [Decoder] - Records[0]
[tester::#EG2] [Decoder] - Record
[tester::#EG2] [Decoder] - Length (11)
[tester::#EG2] [Decoder] - Attributes (0)
[tester::#EG2] [Decoder] - TimestampDelta (0)
[tester::#EG2] [Decoder] - OffsetDelta (0)
[tester::#EG2] [Decoder] - KeyLength (-1)
[tester::#EG2] [Decoder] - ValueLength (5)
[tester::#EG2] [Decoder] - Value ([97 112 112 108 101] → UTF-8: (apple))
[tester::#EG2] [Decoder] - HeadersLength (-1)
[tester::#EG2] [Decoder] :cross_mark: RecordBatches (decode error)
[tester::#EG2] Received bytes:
[tester::#EG2] Hex (bytes 137-144) | ASCII
[tester::#EG2] ------------------------------------------------±-----------------
[tester::#EG2] 70 70 6c 65 01 00 00 00 | pple…
[tester::#EG2] ^ ^
[tester::#EG2] Expected recordbatches size to be 73, got 1
[tester::#EG2] Test failed
[tester::#EG2] Terminating program
[your_program] received 0 bytes, closing this socket!!
[tester::#EG2] Program terminated successfully

Hey @rajneeshks, could you upload your code to GitHub and share the link? It will be much easier to debug if I can run it directly.

Hi @andy1li - uploaded to github:

Specific code block that manages the response:

@rajneeshks The issue is caused by the hardcoded RecordBatches size:

Please note that RecordBatches are of type COMPACT_RECORDS:

Let me know if you’d like further clarification!