Closed bhuvanracham closed 2 years ago
Got it working. "avro_value_set_enum" did the trick.
json_int_t symbol_value;
symbol_value = (json_int_t) avro_schema_enum_get_by_name(schema, json_string_value(json));
avro_value_set_enum(current_val, symbol_value);
After retrieving the symbol value (int) successfully and using avro_value_set_int(avro_value_t, json_int_t), libserdes producer is not writing it in a format that can be digested by the consumer (always returns the first symbol of enum set). Using a Java based producer to write the same enum is resulting in consumers getting the right enum symbol. Do anyone have AVRO_ENUM serialization working in avro-c interfaces on the producer side?
Code snippet that is not working as expected is as below.
Thanks.