...
Consuming Message (this set of API will also be Public enabling CDAP Apps, including Tracker, to consume (audit) messages from MessagingService:
For consuming messages non-transactionally:
- List<Message> List<Record> poll(TopicId topic) throws TopicNotFoundException;
- List<Message> List<Record> poll(TopicId topic, long timestampInMs, boolean inclusive) throws TopicNotFoundException;
- List<Message> List<Record> poll(TopicId topic, MessageId messageId, boolean inclusive) throws TopicNotFoundException;
- List<Message> List<Record> poll(TopicId topic, long timestampInMs, boolean inclusive, long int maxMessages) throws TopicNotFoundException;
- List<Message> List<Record> 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> poll(TopicId topic, Transaction transaction) throws TopicNotFoundException;
- List<Record> poll(TopicId topic, MessageId messageId, boolean inclusive, Transaction transaction) throws TopicNotFoundException;
- List<Record> poll(TopicId topic, long timestampInMs, boolean inclusive, Transaction transaction) throws TopicNotFoundException;
- List<Record> poll(TopicId topic, MessageId messageId, boolean inclusive, int maxMessages, Transaction transaction) throws TopicNotFoundException;
- List<Record> poll(TopicId topic, long timestampInMs, boolean inclusive, int maxMessages, Transaction transaction) throws TopicNotFoundException;
class
...
Record {
MessageId messageId;
byte[]
...
message;
}
class MessageId {
long publish_timestamp;
short seq_id;
long write_timestamp;
short p_seq_id;
}