more explanations added to the code

This commit is contained in:
iliax 2023-05-03 17:20:48 +04:00
parent 100a2c4aed
commit cbc3f174b5

View file

@ -252,6 +252,9 @@ public class ConsumerOffsetsSerde implements BuiltInSerde {
String result;
var bb = ByteBuffer.wrap(data);
short version = bb.getShort();
// ideally, we should distinguish if value is commit or metadata
// by checking record's key, but our current serde structure doesn't allow that.
// so, we trying to parse into metadata first and after into commit msg
try {
result = toJson(
switch (version) {