Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • 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 same transactionWritePointer, then this call will store the messages 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 same transactionWritePointer, 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 provided

Rollback Transactionally published messages 

...

  • Request method and URI
    • POST [base_url]/topics/[topic]/poll
  • Request Schema
    • { "messageIdstartFrom" : [ "bytes", "null" ], "timestamp" : [ "long", "null" ], "inclusive" : "boolean", "limit" : [ "integer", "null" ], "transaction" : [ "bytes" , "null" ] }
       
  • Response Schema (will be in JSON or Avro binary based on the request Content-Type)
    • { "type" : "array", "items" : {"type": "record", "name": "Message", "fields": [ { "name" : "id" , "type" : "bytes" }, {"name" : "payload" : "type" : "bytes" }] }}

       

  • Request body
    • Can be avro binary be Avro binary or JSON, based on the request - Content-Type: application/json or avro/binary
    • Schema Fields:
      i) messageId startFrom - Contains bytes that correspond to the messageId
      ii) timestamp - Timestamp in ms as a string
      iiican be bytes in which case it is considered as messageId, can be long in which case it is considered as timestamp
      ii) inclusive - boolean field that says whether the messageId/timestamp should be inclusive
      iviii) limit - max number of responses to return
      vreturn [an hard limit will be set by the TransactionServer which will be a cConf property]
      iv) transaction -  serialized bytes (TransactionCodec) of the transaction object

  • Response :
    404 NOT FOUND if topic is not present
    200 OK Response body contains an avro Avro binary or JSON object based on the request Content-Type with the response schema as mentioned above

Programmatic

Programmatic API will be used by clients to publish/poll messages from the Messaging Service. They are just a wrapper around the REST APIs.

...