kafka-streams icon indicating copy to clipboard operation
kafka-streams copied to clipboard

Skip key only if it's not buffer

Open polovi opened this issue 4 years ago • 2 comments

polovi avatar Jun 25 '20 17:06 polovi

Hi

@polovi can you add a little bit more context about this change. It seems more counterintuitive for me but we would love to get more info about this in order to help you mitigate this problem.

wtrocki avatar Aug 10 '20 11:08 wtrocki

Hi, in function mapBufferKeyToString it never convert key as Buffer to string because it return object as it is in condition

if (Buffer.isBuffer(object.key)) {
  return object;
}

It should skip these condition if key is Buffer and continue to conversion

try {
  const key = object.key.toString("utf8");
  if (key) {
    object.key = key;
  }
} catch (_) {
  //empty
}

polovi avatar Sep 23 '20 19:09 polovi