pip/pip-64.md
Currently, Pulsar provides a REST endpoint for managing resources in a Pulsar cluster. Additionally it also provides methods to query the state for those resources. But it lacks the ability to produce, consume and read messages through the web service. It is a bit inconvenient for applications that wants to use HTTP to interact with Pulsar. This proposal proposes to introduce REST endpoints for producing, consuming and reading messages via the web service.
Produce messages to a topic, optionally specifying keys or partitions for the messages. If no partition is provided, one will be chosen based on the hash of the key. If no key is provided, the partition will be chosen for each message in a round-robin fashion. Schemas may be provided as the full schema encoded as a string, or, after the initial request may be provided as the schema version returned with the first response.
bytes or none.key_schema or value_schema fieldsvalue_schema fieldProduce messages to one partition of a topic. Schemas may be provided as the full schema encoded as a string, or, after the initial request may be provided as the schema version returned with the first response.
bytes or none.key_schema or value_schema fieldsvalue_schema fieldFetch messages from one partition of a topic. The format of the embedded data returned by this request is determined by the schema of the topic.
max_messages and max_bytes.The consumers resource provides access to the current state of subscription, allows you to create a consumer in a subscription and consume messages from topics and partitions.
Because consumers are stateful, any consumer created with the REST API are tied to a specific broker. A full URL is provided when the instance is created and it should be used to construct any subsequent requests. Failing to use the returned URL for future consumer requests will result in 404 errors because the consumer will not be found.
Create a new consumer instance in the subscription.
Fetch messages from a given consumer. The format of the embedded data returned by this request is determined by the schema of the topic.
max_messages and max_bytes.Remove the consumer from the subscription.
Note that this request must be made to the specific broker holding the consumer instance.
Get the current cursor for a given subscription.
Note: this request must be made to the specific broker that owns the topic
Update the current cursor for a given subscription.
Note: this request must be made to the specific broker that owns the topic
This PIP is introducing new features. It doesn’t change or remove any existing endpoints. So there is nothing to deprecate or migrate.
N/A