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
We are using KafkaFlow to write Avro messages to Kafka.
Our classes are generated from a protocol-file using avrogen.
One of the fields is a long of logical type "timestamp-millis", which is converted to a DateTime property in the class.
When writing a message using our KafkaFlow producer, the DateTime field is then serialized to a string in format "yyyy-mm-ddThh:mm:ss".
The consumer is a telegraf Kafka consumer plugin which, based on the schema, expects the "ProductionStart" field to be a long and tries to convert it as such, resulting in an error.
I assume this is correct behavior on the consumer's end and the producer should instead serialize the DateTime as a long, in accordance with the schema.
Is there a way to configure KafkaFlow to serialize DateTime as long?
Or is DateTime not the correct type for a timestamp_ms field and should I look into the classes generated by avrogen?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
We are using KafkaFlow to write Avro messages to Kafka.
Our classes are generated from a protocol-file using avrogen.
One of the fields is a long of logical type "timestamp-millis", which is converted to a DateTime property in the class.
{ "type" : "record", "name" : "Production", "namespace" : "", "fields" : [ { "name" : "ProductionStart", "type" : { "type" : "long", "logicalType" : "timestamp-millis" } }
When writing a message using our KafkaFlow producer, the DateTime field is then serialized to a string in format "yyyy-mm-ddThh:mm:ss".
The consumer is a telegraf Kafka consumer plugin which, based on the schema, expects the "ProductionStart" field to be a long and tries to convert it as such, resulting in an error.
I assume this is correct behavior on the consumer's end and the producer should instead serialize the DateTime as a long, in accordance with the schema.
Is there a way to configure KafkaFlow to serialize DateTime as long?
Or is DateTime not the correct type for a timestamp_ms field and should I look into the classes generated by avrogen?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions