Uploaded image for project: 'Spring Integration'
  1. Spring Integration
  2. INT-3743

ApacheCommonsFileTailingMessageProducer remember state when restarting

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 5.2 Backlog
    • Component/s: File Support
    • Labels:
      None

      Description

      The FileTailingMessageProducer (both the ApacheCommonsFileTailingMessageProducer and the OSDelegatingFileTailingMessageProducer) currently do not save their state to disk. Therefore the information about the number of lines of the file that were processed is lost when the JVM exits.

      A requirement many organizations have is that a tailer can be restarted and upon restart continues tailing the file at the line number that it was interrupted at. Therefore the line numbers must be saved to a db or a disk.

      The following information is from Gary's answer to my question on SO and describes how this should be implemented using the MetadataStore:

      Spring Integration has an an abstraction MetadataStore - it's a simple key/value abstraction so would be perfect for this use case.

      There are several implementations. The PropertiesPersistingMetadataStore persists to a properties file and, by default, only persists on an ApplicationContext close() (destroy()).

      It implements Flushable so it can be flush()ed more often.

      The other implementations (Redis, MongoDB, Gemfire) don't need flushing because the data is written immediately.

        Attachments

          Activity

            People

            Assignee:
            grussell Gary Russell
            Reporter:
            1123 Benedikt Linse
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: