Package de.otto.synapse.compaction.s3
Class SnapshotMessageConsumer
- java.lang.Object
-
- de.otto.synapse.compaction.s3.SnapshotMessageConsumer
-
- All Implemented Interfaces:
de.otto.synapse.consumer.MessageConsumer<java.lang.String>,java.util.function.Consumer<de.otto.synapse.message.Message<java.lang.String>>
public class SnapshotMessageConsumer extends java.lang.Object implements de.otto.synapse.consumer.MessageConsumer<java.lang.String>AMessageConsumerthat is used to update Snapshots.
-
-
Constructor Summary
Constructors Constructor Description SnapshotMessageConsumer(de.otto.synapse.translator.MessageFormat messageFormat, de.otto.synapse.state.StateRepository<java.lang.String> stateRepository)Creates a StatefulMessageConsumer.
-
Method Summary
Modifier and Type Method Description voidaccept(de.otto.synapse.message.Message<java.lang.String> message)java.util.regex.PatternkeyPattern()Returns the pattern ofmessage keysaccepted by this consumer.java.lang.Class<java.lang.String>payloadType()Returns the expected payload type ofeventsconsumed by this EventConsumer.
-
-
-
Constructor Detail
-
SnapshotMessageConsumer
public SnapshotMessageConsumer(de.otto.synapse.translator.MessageFormat messageFormat, de.otto.synapse.state.StateRepository<java.lang.String> stateRepository)Creates a StatefulMessageConsumer.The message's
Key.partitionKey()is used as the key for repository entries.- Parameters:
messageFormat- the format used to write messages into the snapshotstateRepository- the StateRepository that is holding the State
-
-
Method Detail
-
payloadType
@Nonnull public java.lang.Class<java.lang.String> payloadType()
Returns the expected payload type ofeventsconsumed by this EventConsumer.- Specified by:
payloadTypein interfacede.otto.synapse.consumer.MessageConsumer<java.lang.String>- Returns:
- payload type
-
keyPattern
@Nonnull public java.util.regex.Pattern keyPattern()
Returns the pattern ofmessage keysaccepted by this consumer.- Specified by:
keyPatternin interfacede.otto.synapse.consumer.MessageConsumer<java.lang.String>- Returns:
- Pattern
-
accept
public void accept(de.otto.synapse.message.Message<java.lang.String> message)
- Specified by:
acceptin interfacejava.util.function.Consumer<de.otto.synapse.message.Message<java.lang.String>>
-
-