Versions Compared

Key

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

...

Store Messages to Payload Table 
  • Request method and URI

    • POST [base_url]/topics/[topic]/store
  • Request body should contain transactionWritePointer and  and messages 

  • Response:
    404 NOT FOUND if the topic is not present
    200 OK if message is persisted
Publish Messages to Message Table 
  • Request method and URI
    • POST [base_url]/topics/[topic]/publish
  • Request
    • Request can optionally contain transactionWritePointer. If store calls were made previously with the same transactionWritePointer, the messages array should be empty.

    • This call can be preceded by multiple calls to the 'store' endpoint. If it is preceded by calls to store with
    same
    • same transactionWritePointer, then this endpoint should be called with an empty messages field. If it is not preceded by store calls with
    same
    • same transactionWritePointer, then this call will store
    the
    • 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

    Response Body:

    • If the publish is non-transactional, the response body is empty

    • If the publish is transactional, the response body will contains the information needed for rollback with the following schema

      Code Block
      languagejs
      {
        "type" : "record",
        "name" : "PublishResponse",
        "fields" : [
          { "name" : "transactionWritePointer", "type" : [ "long", "null" ] },
          {
            "name" : "messages",
            "type" : {
              "type" : "array",
              "items" : {
                "type" : "record",
                "name" : "MessageInfo",
                "fields" : [
                  { "name" : "publishTimestamp", "type" : "long" },
                  { "name" : "sequenceId", "type" : "int" }
                ]
              }
            }
          }
        ]
      }
    • 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 

  • Request method and URI

    • POST [base_url]/topics/[topic]/rollback
  • Request Body

    • Use the response body as is from the publish call above
  • Response:

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

...