Package org.acemq.amqp.core
Class StreamOptions
java.lang.Object
org.acemq.amqp.core.StreamOptions
How a stream should be read.
Built by the DSL rather than by hand:
mq.stream("orders.log", OrderPlaced.class)
.fromFirst()
.prefetch(200)
.skipFailures()
.consume(message -> project(message.payload()));
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhat to do when a handler throws. -
Method Summary
Modifier and TypeMethodDescriptioncodec()static StreamOptionsdefaults()fromLast()fromNext()fromOffset(long offset) offset()prefetch(int prefetch) intCarries on past a message whose handler failed.toString()withOffset(StreamOffset offset)
-
Method Details
-
defaults
- Returns:
- read only messages written from now on, with a prefetch of 100
-
fromFirst
- Returns:
- everything the stream still holds, oldest first
-
fromLast
- Returns:
- the last chunk the stream holds and everything after it
-
fromNext
- Returns:
- only messages written after this consumer attaches
-
fromOffset
- Parameters:
offset- exact position, normally one past the last offset recorded as handled- Returns:
- options starting there
-
from
- Parameters:
timestamp- point in time to start from- Returns:
- options starting at the first message written at or after it
-
fromLast
- Parameters:
age- how far back to begin- Returns:
- options replaying that period and then continuing
-
withOffset
- Parameters:
offset- where to start- Returns:
- options starting there
-
prefetch
- Parameters:
prefetch- how many unacknowledged messages the broker may have in flight- Returns:
- options with that prefetch
-
skipFailures
Carries on past a message whose handler failed.- Returns:
- options that skip failures rather than stopping
-
as
- Parameters:
codec- the format to read with, for formats whose bytes describe nothing- Returns:
- options reading that format
-
offset
- Returns:
- where reading starts
-
prefetchCount
public int prefetchCount()- Returns:
- how many unacknowledged messages may be in flight
-
onFailure
- Returns:
- what happens when a handler throws
-
codec
- Returns:
- the format this consumer was told to read, if it was told one
-
toString
-