public interface StreamingIterator
StreamingIterator is provided by Stream and is used to
retrieve messages a specified stream like a read-only iterator.| Modifier and Type | Method and Description |
|---|---|
KeyValue |
attributes()
Returns the attributes of this
StreamingIterator instance. |
boolean |
hasNext()
Returns
true if this iterator has more messages when
traversing the iterator in the forward direction. |
boolean |
hasPrevious()
Returns
true if this partition iterator has more messages when
traversing the iterator in the reverse direction. |
Message |
next()
Returns the next message in the iteration and advances the offset position.
|
String |
nextPosition()
Returns the position of the message that would be returned by a
subsequent call to
next(). |
Message |
previous()
Returns the previous message in the iteration and moves the offset
position backwards.
|
String |
previousPosition()
Returns the position of the message that would be returned by a
subsequent call to
previous(). |
KeyValue attributes()
StreamingIterator instance.
There are some standard attributes defined by OMS for Stream:
OMSBuiltinKeys.OPERATION_TIMEOUT, the default timeout period for operations of Stream.
boolean hasNext()
true if this iterator has more messages when
traversing the iterator in the forward direction.true if the iterator has more messagesMessage next()
This method may be called repeatedly to iterate through the iteration,
or intermixed with calls to previous() to go back and forth.
OMSRuntimeException - if the iteration has no more message, or
the the consumer fails to receive the next messageboolean hasPrevious()
true if this partition iterator has more messages when
traversing the iterator in the reverse direction.true if the partition iterator has more messages when
traversing the iterator in the reverse directionMessage previous()
This method may be called repeatedly to iterate through the iteration backwards,
or intermixed with calls to next() to go back and forth.
OMSRuntimeException - if the iteration has no previous message, or
the the consumer fails to receive the previous messageString nextPosition()
next().OMSRuntimeException - if the iteration has no next messageString previousPosition()
previous().OMSRuntimeException - if the iteration has no previous messageCopyright © 2017–2018 OpenMessaging. All rights reserved.