Pulsar REST
To connect to Pulsar, you need to specify a URL.
Produce messages to non-partitioned or partitioned topics
Produce messages to specific partitions of partitioned topics
Producer
Currently, you can produce messages to the following destinations with tools like cURL or Postman via REST.
note
You can only produce messages to topics that already exist in Pulsar via REST.
Consuming and reading messages via REST will be supported in the future.
Below is the structure of a request payload.
-
Parameter Required? Type Description Yes String
Actual message payload
Messages are sent in strings and encoded with given schemas on the server sideproperties
No Map<String, String>
Custom properties key
No String
Partition key replicationClusters
No List<String>
Clusters to which messages replicate No String
Message event time sequenceId
No long
Message sequence ID disableReplication
No boolean
Whether to disable replication of messages deliverAt
No long
Deliver messages only at or after specified absolute timestamp No long
Deliver messages only after specified relative delay (in milliseconds)
Currently, Primitive, Avro, JSON, and KeyValue schemas are supported.
For Primitive, Avro and JSON schemas, schemas should be provided as the full schema encoded as a string.
Below is an example of sending messages to topics using JSON schema via REST.
Send messages to topics with JSON schema using the command below.