public abstract class MessageLogReceiverEndpoint extends MessageReceiverEndpoint
MessageEndpoint endpoint of a Message Channel that supports random-access like reading of
messages using ChannelPositions.
| Constructor and Description |
|---|
MessageLogReceiverEndpoint(java.lang.String channelName,
com.fasterxml.jackson.databind.ObjectMapper objectMapper,
org.springframework.context.ApplicationEventPublisher eventPublisher) |
| Modifier and Type | Method and Description |
|---|---|
ChannelPosition |
consume(ChannelPosition startFrom)
Takes zero or more messages from the channel, calls
MessageEndpoint.intercept(Message) for every message, and notifies
the registered consumers with the intercepted message, or drops the message, if intercept returns null. |
abstract ChannelPosition |
consumeUntil(ChannelPosition startFrom,
java.time.Instant until)
Takes zero or more messages from the channel, calls
MessageEndpoint.intercept(Message) for every message, and notifies
the registered consumers with the intercepted message, or drops the message, if intercept returns null. |
abstract void |
stop() |
getEndpointType, getMessageDispatcher, publishEvent, registergetChannelName, getInterceptorChain, intercept, registerInterceptorsFrompublic MessageLogReceiverEndpoint(@Nonnull
java.lang.String channelName,
@Nonnull
com.fasterxml.jackson.databind.ObjectMapper objectMapper,
@Nullable
org.springframework.context.ApplicationEventPublisher eventPublisher)
@Nonnull public final ChannelPosition consume(@Nonnull ChannelPosition startFrom)
MessageEndpoint.intercept(Message) for every message, and notifies
the registered consumers with the intercepted message, or drops the message, if intercept returns null.
Consumption starts with the first message after startFrom and finishes when either the
stopCondition is met, or the application is shutting down.
The returned ChannelPosition is the position of the last message that was processed by the
MessageLogReceiverEndpoint - whether it was dropped or consumed.
The registered consumers are used as a
callback for consumed messages. A MessageDispatcher can be used as a consumer, if multiple
consumers, or consumers with message payloads other than String are
required.
startFrom - the start position used to proceed message consumption@Nonnull public abstract ChannelPosition consumeUntil(@Nonnull ChannelPosition startFrom, @Nonnull java.time.Instant until)
MessageEndpoint.intercept(Message) for every message, and notifies
the registered consumers with the intercepted message, or drops the message, if intercept returns null.
Consumption starts with the first message after startFrom and finishes when either the
stopCondition is met, or the application is shutting down.
The returned ChannelPosition is the position of the last message that was processed by the
MessageLogReceiverEndpoint - whether it was dropped or consumed.
The registered consumers are used as a
callback for consumed messages. A MessageDispatcher can be used as a consumer, if multiple
consumers, or consumers with message payloads other than String are
required.
startFrom - the start position used to proceed message consumptionuntil - the arrival timestamp until the messages should be consumedpublic abstract void stop()