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.