Versions Compared

Key

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

...

  • Request method and URI
    • POST [base_url]/topics/[topic]/publish
  • Request body
    • JSON object containing payload and optionally transaction write pointer

      { "payload" : [ payload byte array ], "tx_write_ptr" : 12345L,  "buffer" : true }

      Fields:
      i) payload - Contains the payload in the form of array of bytes
      ii) tx_write_ptr (optional) - Contains a long that corresponds to a transaction write pointer. If this field is not provided, then the publishing of message is performed non-transactionally
      iii) buffer (optional) - A boolean flag that indicates whether the messages can be buffered on the client side or should it the message be persisted in a Payload table
       

  • Response :
    404 NOT FOUND if topic is not present
    200 OK if message is persisted

  • Commit Transactionally published messages
    • POST [base_url]/topics/[topic]/commit
    • Request body should contain the transaction write pointer that should be committed

      { "tx_write_ptr" :  12345L }

      Response :
      404 NOT FOUND if topic is not present
      200 OK if messages are persisted persisted

       

  • Rollback Transactionally published messages 
    • POST [base_url]/topics/[topic]/rollback
    • Request body should contain the transaction write pointer that should be rolled back

      { "tx_write_ptr" :  12345L }

      Response :
      404 NOT FOUND if topic is not present
      200 OK if messages are rolled back

      TBD: When or should the client retry? If it could not be rolled back, the transaction should be invalidated.

       

Consume Message

  • Request method and URI
    • POST [base_url]/topics/[topic]/poll
  • Request body
    • An optional JSON object that contains the offset (either messageId or timestamp) and limit

      { "messageId" : [ message id byte array ], "timestamp" : 12454L,  "inclusive" : true, "limit" : 40, "transaction" : [Serialized Transaction Object] }

      Fields (all the fields are optional):
      i) messageId: Provide a messageId as an offset into the topic message queue
      ii) timestamp: Provide a timestamp as an offset into the topic message queue. Note that either messageId or timestamp needs to be provided. If both are provided, then messageId will be used.
      iii) inclusive: This boolean flag indicates whether the offset is inclusive or exclusive
      iv) limit: Max number of messages to return, by default it is set to 100.
      v) transaction: If message polling needs to be done transactionally, then this  

...