You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when using the Kafka Client and sending/emitting an object with a measurement like: { time: 1, value: 12 }
the boolean isNotKafkaMessage becomes false, thinking the message is a typical KafkaJS message with key and value attributes.
Of course, the intention is to treat this message as a JSON object that in the end needs to be serialized using JSON.stringify()
Describe the solution you'd like
in my opinion the check should be changed to:
!(('key'invalue)&&('value'invalue))
to check both key and value attribute names existence in the object...
I think the docs on the Kafka Client should be updated with the notion you should not use the attributes names value or key in the messages you want to send/emit.
Possibly an explainer on how to use your own Serializer and attach that to the KafkaClient
What is the motivation / use case for changing the behavior?
To not have to particularly exclude used keyword value or key but only treat the message as a Kafka message if they both exist.
The text was updated successfully, but these errors were encountered:
Is there an existing issue that is already proposing this?
Is your feature request related to a problem? Please describe it
When using the Kafka client the default serializer (KafkaRequestSerializer) checks if a message is not a Kafka(JS) message using:
when using the Kafka Client and sending/emitting an object with a measurement like:
{ time: 1, value: 12 }
the boolean
isNotKafkaMessage
becomesfalse
, thinking the message is a typical KafkaJS message withkey
andvalue
attributes.Of course, the intention is to treat this message as a JSON object that in the end needs to be serialized using
JSON.stringify()
Describe the solution you'd like
in my opinion the check should be changed to:
to check both
key
andvalue
attribute names existence in the object...Teachability, documentation, adoption, migration strategy
I think the docs on the Kafka Client should be updated with the notion you should not use the attributes names
value
orkey
in the messages you want to send/emit.Possibly an explainer on how to use your own Serializer and attach that to the KafkaClient
What is the motivation / use case for changing the behavior?
To not have to particularly exclude used keyword
value
orkey
but only treat the message as a Kafka message if they both exist.The text was updated successfully, but these errors were encountered: