Parsing and validation of message.key should work for string and avro? data types.
Current Behavior
If the message key is of string data type, the application parses it into a string incorrectly. A message key "bookOrdered" is parsed into "//"bookOrdered"".
Possible Solution
I believe a possible solution could be to figure out how to properly parse bytes/Buffer to a string. The data type of a KafkaMessage by KafkaJS allows it to be Buffer | undefined, so this might be an issue as well.
Necessity
We want to provide users with flexibility to use strings or avro? data types as their message keys and let us handle the ambiguity of parsing and validating it.
Expected Behavior
Parsing and validation of message.key should work for string and avro? data types.
Current Behavior
If the message key is of string data type, the application parses it into a string incorrectly. A message key
"bookOrdered"
is parsed into"//"bookOrdered""
.Possible Solution
I believe a possible solution could be to figure out how to properly parse bytes/Buffer to a string. The data type of a KafkaMessage by KafkaJS allows it to be
Buffer | undefined
, so this might be an issue as well.Necessity
We want to provide users with flexibility to use strings or avro? data types as their message keys and let us handle the ambiguity of parsing and validating it.