@Beta public interface MessageFetcher
Modifier and Type | Method and Description |
---|---|
CloseableIterator<Message> |
fetch(String namespace,
String topic,
int limit,
long timestamp)
Fetches messages from the given topic that were published on or after the given timestamp.
|
CloseableIterator<Message> |
fetch(String namespace,
String topic,
int limit,
String afterMessageId)
Fetches messages from the given topic that were published after a message, identified by the given
message id.
|
CloseableIterator<Message> fetch(String namespace, String topic, int limit, long timestamp) throws TopicNotFoundException, IOException
namespace
- namespace of the topictopic
- name of the topiclimit
- maximum number of messages to fetchtimestamp
- timestamp in milliseconds; the publish timestamp of the first Message
returned by the resulting CloseableIterator
will be on or after the given timestamp.
Use timestamp = 0
to poll from the first available message.CloseableIterator
of Message
IllegalArgumentException
- if the topic name is invalid. A valid id should only contain alphanumeric
characters, _
, or -
.IOException
- if there was a failure to communicate with the messaging systemTopicNotFoundException
- if the give topic doesn't existCloseableIterator<Message> fetch(String namespace, String topic, int limit, @Nullable String afterMessageId) throws TopicNotFoundException, IOException
namespace
- namespace of the topictopic
- name of the topiclimit
- maximum number of messages to fetchafterMessageId
- message id returned from the Message.getId()
method from a prior call to
one of the pollMessages
methods. If it is null
, it will fetch from
the first available message.CloseableIterator
of Message
IllegalArgumentException
- if the topic name is invalid. A valid id should only contain alphanumeric
characters, _
, or -
.IOException
- if there was a failure to communicate with the messaging systemTopicNotFoundException
- if the give topic doesn't existCopyright © 2020 Cask Data, Inc. Licensed under the Apache License, Version 2.0.