Rest Proxy Definitions: ProduceRequest

Description

Used as input for the Produce service.

Field name Type Description

keyMessage

JSONObject

(required) The key data, see the Rest Message for available types

valueMessage

JSONObject

(required) The value data, see the Rest Message for available types

Available Rest Message Types

Name

Use

StringMessage

Used to write an UTF8 String to the key or value

AvroMessage

Used to write an Avro encoded message to the key or value. Input is a JSON String

AvroJsonMessage

Used to write an Avro encoded message to the key or value. Input is a JSON Object

NullMessage

Used to write NULL (no data) to the key or value

Examples

Key NULL and value STRING
{
    "keyMessage" : {
        "type" : "NULL"
    },
    "valueMessage" : {
        "type" : "STRING",
        "message" : "Hello World!"
    }
}
Key STRING and value AVRO
{
    "keyMessage" : {
        "type" : "STRING",
        "message" : "Hello"
    },
    "valueMessage" : {
        "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\"}"
    }
}
Key AVRO and value AVROJSON
{
    "keyMessage" : {
        "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\"}"
    },
    "valueMessage" : {
        "type" : "AVROJSON",
        "schemaId" : 1,
        "message" : {
            "random" : "Hello World"
        }
    }
}