Class JournalingInterceptor

java.lang.Object
de.otto.synapse.journal.JournalingInterceptor
All Implemented Interfaces:
MessageInterceptor

public class JournalingInterceptor extends Object implements MessageInterceptor
Interceptor used to add the messages of event-sourced entities to a Journal.
  • Constructor Details

    • JournalingInterceptor

      public JournalingInterceptor(@Nonnull String channelName, @Nonnull Journal journal)
      Creates a JournalingInterceptor for a channel, using the given Journal.
      Parameters:
      channelName - the name of the journaled channel
      journal - the Journal used to record messages for the channel
      Throws:
      IllegalStateException - if the Journal's MessageStore does not provide an Index.JOURNAL_KEY
  • Method Details

    • intercept

      @Nonnull public TextMessage intercept(@Nonnull TextMessage message)
      Description copied from interface: MessageInterceptor
      Intercept a message and return the same message, a modified version of the incoming message, or null, if the message should be filtered out and dropped by the AbstractMessageEndpoint
      Specified by:
      intercept in interface MessageInterceptor
      Parameters:
      message - the channel-layer message with payload-type beeing a String
      Returns:
      intercepted version of the message, or null if the message should be dropped.
    • getJournal

      public Journal getJournal()