public class KinesisMessageLogResponse
extends java.lang.Object
| Constructor and Description |
|---|
KinesisMessageLogResponse(java.lang.String channelName,
com.google.common.collect.ImmutableList<KinesisShardResponse> shardResponses) |
| Modifier and Type | Method and Description |
|---|---|
void |
dispatchMessages(de.otto.synapse.consumer.MessageConsumer<java.lang.String> messageConsumer)
Dispatches all messages from the response to some
MessageConsumer. |
de.otto.synapse.channel.ChannelDurationBehind |
getChannelDurationBehind() |
java.lang.String |
getChannelName() |
de.otto.synapse.channel.ChannelPosition |
getChannelPosition() |
java.util.List<de.otto.synapse.message.Message<java.lang.String>> |
getMessages() |
<P> java.util.List<de.otto.synapse.message.Message<P>> |
getMessages(de.otto.synapse.translator.MessageTranslator<P> messageTranslator)
Translates the messages from the response into messages with
payload of type
<P> and returns the translated messages as a list. |
java.util.Set<java.lang.String> |
getShardNames() |
com.google.common.collect.ImmutableList<KinesisShardResponse> |
getShardResponses() |
public KinesisMessageLogResponse(java.lang.String channelName,
com.google.common.collect.ImmutableList<KinesisShardResponse> shardResponses)
public java.lang.String getChannelName()
public de.otto.synapse.channel.ChannelDurationBehind getChannelDurationBehind()
public java.util.List<de.otto.synapse.message.Message<java.lang.String>> getMessages()
public <P> java.util.List<de.otto.synapse.message.Message<P>> getMessages(de.otto.synapse.translator.MessageTranslator<P> messageTranslator)
payload of type
<P> and returns the translated messages as a list.P - the type of the returned messages payloadmessageTranslator - the MessageTranslator used to translate the message payloadpublic void dispatchMessages(de.otto.synapse.consumer.MessageConsumer<java.lang.String> messageConsumer)
MessageConsumer.
The MessageDispatcher can be used to consume and transform the messages into messages
with some custom payload and dispatch these messages to one or more MessageConsumers:
final KinesisMessageLogResponse response = kinesisMessageLogReader.read(iterator).get();
final MessageConsumer<TestPayload> consumer = someTestMessageConsumer();
response.dispatchMessages(new MessageDispatcher(new ObjectMapper(), singletonList(consumer)));
messageConsumer - the MessageConsumerpublic java.util.Set<java.lang.String> getShardNames()
public com.google.common.collect.ImmutableList<KinesisShardResponse> getShardResponses()
public de.otto.synapse.channel.ChannelPosition getChannelPosition()