Rest Proxy Definitions: AvroMessage
Description
The AvroMessage 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 an escaped JSON Object stored in a JSON String.
Field name | Type | Description |
---|---|---|
type |
string |
(required constant) |
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 and then stored in a JSON String |
Examples
with Schema
{
"type" : "AVRO",
"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" : "AVRO",
"schemaId" : 1,
"message" : "{\"random\":\"Hello World\"}"
}