Describe the bug
JSON to Avro over HTTP is not behaving as expected:
- Validation failures produce blank message
- Validation failure only logs one missing attribute
- Partial valid message logs unhelpful error "Expected string. Got END_OBJECT"
To Reproduce
sse avro example.zip
Steps to reproduce the behavior:
-
start example
-
start stream
curl --location --request GET 'http://localhost:7114/sse/stream' -v \
--header 'Content-Type: text/plain' \
--data '["NjNiNTU5Y2MtMjJhMC00YzMwLTgzOGMtZWE4OTZhOTBlMTQx","AQIABA=="]'
-
send good payload
curl --location 'http://localhost:7114/sse/events' -v \
--header 'Content-Type: application/json' \
--data '{"id": "anID","status": "aStatus"}'
-
everything works
-
send bad payload
curl --location 'http://localhost:7114/sse/events' -v \
--header 'Content-Type: application/json' \
--data '{"name": "a name"}'
zilla-avro-sse.north_http_server [11/Jul/2024:15:00:56 +0000] BINDING_HTTP_REQUEST_ACCEPTED - POST http://localhost:7114/sse/events
1720710056288:zilla-avro-sse south_kafka_client: Skipping invalid message on topic events-sse, partition 0, offset 2
zilla-avro-sse.south_kafka_cache_server [11/Jul/2024:15:00:56 +0000] MODEL_AVRO_VALIDATION_FAILED A message payload failed validation. Expected field name not found: id
zilla-avro-sse.south_kafka_client [11/Jul/2024:15:00:56 +0000] MODEL_AVRO_VALIDATION_FAILED A message payload failed validation.
-
send partial good
curl --location 'http://localhost:7114/sse/events' -v \
--header 'Content-Type: application/json' \
--data '{"id": "anID"}'
zilla-avro-sse.north_http_server [11/Jul/2024:15:02:34 +0000] BINDING_HTTP_REQUEST_ACCEPTED - POST http://localhost:7114/sse/events
zilla-avro-sse.south_kafka_cache_server [11/Jul/2024:15:02:34 +0000] MODEL_AVRO_VALIDATION_FAILED A message payload failed validation. Expected string. Got END_OBJECT
1720710154266:zilla-avro-sse south_kafka_client: Skipping invalid message on topic events-sse, partition 0, offset 3
zilla-avro-sse.south_kafka_client [11/Jul/2024:15:02:34 +0000] MODEL_AVRO_VALIDATION_FAILED A message payload failed validation.
Expected behavior
It should not produce a message on failure. Validation failures return accurate HTTP error codes with reason and log appropriate failure reason.
Zilla Environment:
sse avro.zip
Describe the bug
JSON to Avro over HTTP is not behaving as expected:
To Reproduce
sse avro example.zip
Steps to reproduce the behavior:
start example
start stream
send good payload
everything works
send bad payload
send partial good
Expected behavior
It should not produce a message on failure. Validation failures return accurate HTTP error codes with reason and log appropriate failure reason.
Zilla Environment:
sse avro.zip