Versions Compared

Key

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

...

  • Request Schema
    • { "transactionWritePointer" : [ "long", "null" ], "messages" : { "type" : "array", "items" : "bytes" }}
       
  • Request body
    • Can be avro Avro binary or JSON, based on the request - Content-Type: application/json or avro/binary
    • Schema Fields:

      1. messages - Contains an array of byte arrays that correspond to messages

      2. transactionWritePointer - Corresponds to a transaction write pointer.

...

  • TopicId extends NamespaceId with a string that represents the topic name.

Creating Topic:

void create(TopicId topic) throws TopicAlreadyExistsException;

Updating Topic properties:

void update(TopicId topic, Map<String, String> properties) throws TopicAlreadyExistsException;

Deleting Topic:

void delete(TopicId topic) throws TopicNotFoundException;

Publishing Message:

For publishing messages non-transactionally:

...

For storing messages in the PayloadTable (requires Transaction - tx_write_ptr)

  • void store(TopicId topic, byte[] message, Transaction transaction) throws TopicNotFoundException;
  • void store(TopicId topic, List<byte[]> messages, Transaction transaction) throws TopicNotFoundException;  

...

  • void rollback(TopicId topic, Transaction transaction) throws TopicNotFoundException;

 

Consuming Message

...

:

For consuming messages non-transactionally:

  • List<Record> List<Message> poll(TopicId topic) throws TopicNotFoundException; 
  • List<Record> List<Message> poll(TopicId topic, long timestampInMs, boolean inclusive) throws TopicNotFoundException;
  • List<Record> List<Message> poll(TopicId topic, MessageId messageId, boolean inclusive) throws TopicNotFoundException;
  • List<Record> List<Message> poll(TopicId topic, long timestampInMs, boolean inclusive, int maxMessages) throws TopicNotFoundException;
  • List<Record> List<Message> poll(TopicId topic, MessageId, messageId, boolean inclusive, int maxMessages) throws TopicNotFoundException;
     

For consuming messages transactionally (timestamp used for polling will correspond to the publish timestamp):

  • List<Record> List<Message> poll(TopicId topic, Transaction transaction) throws TopicNotFoundException;
  • List<Record> List<Message> poll(TopicId topic, MessageId messageId, boolean inclusive, Transaction transaction) throws TopicNotFoundException;
  • List<Record> List<Message> poll(TopicId topic, long timestampInMs, boolean inclusive, Transaction transaction) throws TopicNotFoundException;
  • List<Record> List<Message> poll(TopicId topic, MessageId messageId, boolean inclusive, int maxMessages, Transaction transaction) throws TopicNotFoundException;
  • List<Record> List<Message> poll(TopicId topic, long timestampInMs, boolean inclusive, int maxMessages, Transaction transaction) throws TopicNotFoundException;

Public Programmatic API

Consuming Message:



class Record Message {
    MessageId messageIdid;
    byte[] messagepayload;
}

class MessageId {
  long publish_timestamp;
  short seq_id;
  long write_timestamp;
  short p_seq_id;
}

...