Rest Proxy Definitions: ReceivedMessage
Description
The ReceivedMessage is a container for a consumed message.
Field name | Type | Description |
---|---|---|
messageId |
string |
(required) The unique id assigned to the message |
produceTimestamp |
int64 |
(required) The timestamp when the original message was produced |
produceCluster |
string |
(optional) The cluster where the original message was produced |
consumeCluster |
string |
(optional) The cluster where this message was consumed |
partition |
int32 |
(optional) The partition number where the message was consumed from |
offset |
int64 |
(optional) The offset on the topic partition for the consumed message |
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 |
Used to write an UTF8 String to the key or value |
|
Used to write an Avro encoded message to the key or value. Input is a JSON String |
|
Used to write an Avro encoded message to the key or value. Input is a JSON Object |
|
Used to write NULL (no data) to the key or value |
Examples
{
"messageId": "07e15200-83c4-48ed-8174-c2cece01355b",
"produceTimestamp": 1569927424940,
"partition": 0,
"offset": 7,
"produceCluster": "amsterdam-02",
"consumeCluster": "amsterdam-01",
"keyMessage" : {
"type" : "NULL"
},
"valueMessage" : {
"type" : "STRING",
"message" : "Hello World!"
}
}
{
"messageId": "07e15200-83c4-48ed-8174-c2cece01355b",
"produceTimestamp": 1569927424940,
"partition": 0,
"offset": 7,
"produceCluster": "amsterdam-02",
"consumeCluster": "amsterdam-01",
"keyMessage" : {
"type" : "STRING",
"message" : "Hello"
},
"valueMessage" : {
"type" : "AVRO",
"schema": null,
"schemaId": null,
"message" : "{\"random\":\"Hello World\"}"
}
}
{
"messageId": "07e15200-83c4-48ed-8174-c2cece01355b",
"produceTimestamp": 1569927424940,
"partition": 0,
"offset": 7,
"produceCluster": "amsterdam-02",
"consumeCluster": "amsterdam-01",
"keyMessage": {
"type": "AVRO",
"schema": null,
"schemaId": null,
"message": "{\"random\": \"Hello\"}"
},
"valueMessage": {
"type": "AVROJSON",
"schema": null,
"schemaId": null,
"message" : {
"random" : "Hello World"
}
}
}