Kafka REST 2.0.1: POST /topics/{topic: string}/partitions/{partition_id: string}
Produces messages into a partition of a topic.
Description
Depending on the configuration, the type of information retrieved has different behavior.
See the streams.default.stream
parameter in Kafka REST 2.0.1: Configuration Parameters.
Parameters Defined | Response |
---|---|
streams.default.stream is defined | Produces messages into a partition of MapR-ES topic. The user could pass fully qualified topic name or not. If a fully qualified topic name is not used, messages are produced into topics in the default stream path. |
streams.default.stream is not defined | Produces messages into a partition within MapR-ES topic. The user could only pass fully qualified topic name that contains stream path. |
Parameters | Description |
---|---|
topic_name (string) | Topic to produce the messages to. |
partition_id (int) | Partition to produce the messages to. |
Syntax
http://<host>:8082/topics/<topic_name>/partitions/<partition_id>
Request Example
curl -X POST -H "Content-Type: application/vnd.kafka.binary.v1+json" --data '{"records":[{"key":"a2v5","value":"Y29uZmx1ZW50"}]}' "http://localhost:8082/topics/testtopic1/partitions/0"
Response Example
{"offsets":
[{
"partition":0,
"offset":2,
"error_code":null,"error":null}
],
"key_schema_id":null,
"value_schema_id":null
}