...
There are two separate endpoints to support different publishing cases as described above. They both share the same request format.
Request Body Schema
Code Block language js { "type" : "record", "name" : "PublishRequest", "fields" : [ { "name" : "transactionWritePointer", "type" : [ "long", "null" ] }, { "name" : "messages", "type" : { "type" : "array", "items" : "bytes" } } ] }
- Request body
- Can be Avro binary or JSON, based on the request - Content-Type: application/json or avro/binary
Schema Fields:
messages
- Contains an array of byte arrays that correspond to messagestransactionWritePointer
- Corresponds to a transaction write pointer.
...
- This call can be preceded by multiple calls to the 'store' endpoint. If it is preceded by calls to store with same
transactionWritePointer
, then this endpoint should be called with an empty messages field. If it is not preceded by store calls with sametransactionWritePointer
, then this call will store themessages
to the MessageTable
directly. - If the call does not contain a
transactionWritePointer
, then the messages are stored non-transactionally (ie, without a tx write ptr).POST [base_url]/topics/[topic]/publish
Request schema can optionally contain
transactionWritePointer
. If store calls were made previously with the sametransactionWritePointer
, the messages array should be empty.Response:
404 NOT FOUND if topic is not present
200 OK if messages are persisted
400 BAD REQUEST if the {{transactionWritePointer}} is null and the messages field is empty. Messages field can be empty if the transactionWritePointer is providedResponse Body:
If the publish is non-transactional, the response body is empty
- If the publish is transactional, the response body will contains a set of rollback keys
- The set of rollback keys are needed for the rollback call described below Schema
{ "type" : "array", "items" : "bytes" }
the information needed for rollback with the following schema- The client shouldn't need to parse the response body, but rather treats it as opaque bytes. On rollback, simply use it as the request body.
Rollback Transactionally published messages
...