POST /topics/{topic:string}

Produces messages into a topic with the following behavior.


Depending on the configuration, the type of information retrieved has different behavior. See the and rest.proxy.backend parameters in Configuration Parameters

Table 1. Response Behavior
Parameters Defined Response is defined

Produces messages into specific MapR Streams topics. If the topic name does not contain a stream path, then the default stream path is used. is not defined and rest.proxy.backend=streams

Produces messages into a MapR Streams topic. The topic name should contain a stream path and be encoded. is not defined and rest.proxy.backend=hybrid

Produces messages into a MapR Streams topic if the topic name starts with a forward slash (/) and contains a colon (:). Otherwise, messages are produced into an Apache Kafka topic.

Note: If the topic does not exist, the following error results: [“error_code”:40401, “message”: ”Topic not found.”}. New topics are not created by the POST operation.
Table 2. Parameters
Parameters Description
topic_name (string) Name of the topic to produce the messages to.



Request Example

This example produces a message using binary embedded data with the value, Kafka, to the topic, test.

curl -X POST -H "Content-Type: application/vnd.kafka.binary.v1+json" --data '{"records":[{"value":"S2Fma2E="}]}' "http://localhost:8082/topics/test"

Response Example

        "offset": 1,