public interface StreamingConsumer extends ServiceLifecycle
StreamingConsumer provides low level APIs to open multiple streams
from a specified queue and then retrieve messages from them through @{code StreamingIterator}.
A Queue is consists of multiple streams, the Stream is an abstract concept and
can be associated with partition in most messaging systems.| Modifier and Type | Method and Description |
|---|---|
KeyValue |
attributes()
Returns the attributes of this
StreamingConsumer instance. |
StreamingIterator |
seek(String streamName,
String position)
Creates a
StreamingIterator from the fixed position of the specified stream. |
StreamingIterator |
seekToBeginning(String streamName)
Creates a
StreamingIterator from the begin position of the specified stream. |
StreamingIterator |
seekToEnd(String streamName)
Creates a
StreamingIterator from the end position of the specified stream. |
shutdown, startupKeyValue attributes()
StreamingConsumer instance.
Changes to the return KeyValue are not reflected in physical StreamingConsumer.
There are some standard attributes defined by OMS for StreamingConsumer:
OMSBuiltinKeys.CONSUMER_ID, the unique consumer id for a consumer instance.
OMSBuiltinKeys.OPERATION_TIMEOUT, the default timeout period for operations of StreamingConsumer.
StreamingIterator seekToEnd(String streamName)
StreamingIterator from the end position of the specified stream.streamName - the specified streamStreamingIterator seekToBeginning(String streamName)
StreamingIterator from the begin position of the specified stream.streamName - the specified streamStreamingIterator seek(String streamName, String position)
StreamingIterator from the fixed position of the specified stream.
Creates a StreamingIterator from the begin position if the given position
is earlier than the first message's store position in this stream.
Creates a StreamingIterator from the end position, if the given position
is later than the last message's store position in this stream.
The position is a String value, may represented by timestamp, offset, cursor,
even a casual key.
streamName - the specified streamposition - the specified positionCopyright © 2017–2018 OpenMessaging. All rights reserved.