Class SnapshotMessageConsumer

java.lang.Object
de.otto.synapse.compaction.s3.SnapshotMessageConsumer
All Implemented Interfaces:
de.otto.synapse.consumer.MessageConsumer<String>, Consumer<de.otto.synapse.message.Message<String>>

public class SnapshotMessageConsumer extends Object implements de.otto.synapse.consumer.MessageConsumer<String>
A MessageConsumer that is used to update Snapshots.
  • Constructor Details

    • SnapshotMessageConsumer

      public SnapshotMessageConsumer(de.otto.synapse.translator.MessageFormat messageFormat, de.otto.synapse.state.StateRepository<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 snapshot
      stateRepository - the StateRepository that is holding the State
  • Method Details

    • payloadType

      @Nonnull public Class<String> payloadType()
      Returns the expected payload type of events consumed by this EventConsumer.
      Specified by:
      payloadType in interface de.otto.synapse.consumer.MessageConsumer<String>
      Returns:
      payload type
    • keyPattern

      @Nonnull public Pattern keyPattern()
      Returns the pattern of message keys accepted by this consumer.
      Specified by:
      keyPattern in interface de.otto.synapse.consumer.MessageConsumer<String>
      Returns:
      Pattern
    • accept

      public void accept(de.otto.synapse.message.Message<String> message)
      Specified by:
      accept in interface Consumer<de.otto.synapse.message.Message<String>>