public abstract class AbstractEventSource extends java.lang.Object implements EventSource
| Constructor and Description |
|---|
AbstractEventSource(MessageLogReceiverEndpoint messageLog) |
| Modifier and Type | Method and Description |
|---|---|
ChannelPosition |
consumeUntil(ChannelPosition startFrom,
java.time.Instant until)
Consumes all events from the EventSource, beginning with
startFrom, until
the stopCondition is met. |
java.lang.String |
getChannelName()
Returns the name of the EventSource.
|
MessageDispatcher |
getMessageDispatcher()
Returns the MessageDispatcher used to register
consumers at the EventSource. |
MessageLogReceiverEndpoint |
getMessageLogReceiverEndpoint()
Returns the MessageLogReceiverEndpoint used by the
EventSource to consume events. |
boolean |
isStopping() |
void |
register(MessageConsumer<?> messageConsumer)
Registers a new EventConsumer at the EventSource.
|
void |
stop() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconsume, consume, consumeUntilpublic AbstractEventSource(MessageLogReceiverEndpoint messageLog)
public java.lang.String getChannelName()
EventSourceFor streaming event-sources, this is the name of the event stream.
getChannelName in interface EventSourcepublic void stop()
stop in interface EventSourcepublic boolean isStopping()
isStopping in interface EventSourcepublic void register(MessageConsumer<?> messageConsumer)
consumers have to be thread safe as it may be called from multiple threads
(e.g. for kinesis streams there is one thread per shard)
register in interface EventSourcemessageConsumer - the EventConsumer that is registered at the EventSource@Nonnull public MessageDispatcher getMessageDispatcher()
consumers at the EventSource.getMessageDispatcher in interface EventSource@Nonnull public MessageLogReceiverEndpoint getMessageLogReceiverEndpoint()
EventSourceEventSource to consume events.getMessageLogReceiverEndpoint in interface EventSource@Nonnull public ChannelPosition consumeUntil(@Nonnull ChannelPosition startFrom, @Nonnull java.time.Instant until)
EventSourcestartFrom, until
the stopCondition is met.
The registered consumers will be called zero or more times, depending on
the number of events retrieved from the EventSource.
consumeUntil in interface EventSourcestartFrom - the read position returned from earlier executionsuntil - the arrival timestamp until the messages should be consumed