Interface FileWritingMessageHandler.MessageFlushPredicate

Enclosing class:
FileWritingMessageHandler
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface FileWritingMessageHandler.MessageFlushPredicate
When using FileExistsMode.APPEND_NO_FLUSH an implementation of this interface is called for each file that has pending data to flush when a trigger message is received.
Since:
4.3
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    shouldFlush(String fileAbsolutePath, long firstWrite, long lastWrite, Message<?> filterMessage)
    Return true to cause the file to be flushed and closed.
  • Method Details

    • shouldFlush

      boolean shouldFlush(String fileAbsolutePath, long firstWrite, long lastWrite, Message<?> filterMessage)
      Return true to cause the file to be flushed and closed.
      Parameters:
      fileAbsolutePath - the path to the file.
      firstWrite - the time of the first write to a new or previously closed file.
      lastWrite - the time of the last write - System.currentTimeMillis().
      filterMessage - an optional message to be used in the decision process.
      Returns:
      true if the file should be flushed and closed.