Rest Proxy Definitions: AvroJsonMessage

Description

The AvroJsonMessage is used to represent an Avro Message as a key or value in a message. It uses a schema definition or schema ID to specify the Avro Schema to be used and the message is a JSON Object encoded according to the Avro Specifications

Field name Type Description

type

string

(required constant) AVROJSON

schema

string

(optional) The Avro Schema definition to use as message schema

schemaId

string

(optional) The Avro Schema Registry Id to use as message schema

message

string

(required) The Avro object to write, encoded according to the Avro Specifications

Examples

with Schema
{
    "type" : "AVROJSON",
    "schema" : "{\"type\":\"record\",\"name\":\"Random\",\"namespace\":\"io.axual.examples.general\",\"doc\":\"Object type that is supposed to be filled with a Random value.\",\"fields\":[{\"name\":\"random\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"The random value.\"}]}",
    "message" :  {
        "random" : "Hello World"
    }
}
with Schema Id
{
    "type" : "AVROJSON",
    "schemaId" : 1,
    "message" :  {
        "random" : "Hello World"
    }
}