Class FileAggregator
java.lang.Object
org.springframework.integration.file.aggregator.FileAggregator
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.integration.aggregator.CorrelationStrategy,org.springframework.integration.aggregator.GroupConditionProvider,org.springframework.integration.aggregator.MessageGroupProcessor,org.springframework.integration.aggregator.ReleaseStrategy
public class FileAggregator
extends Object
implements org.springframework.integration.aggregator.CorrelationStrategy, org.springframework.integration.aggregator.ReleaseStrategy, org.springframework.integration.aggregator.GroupConditionProvider, org.springframework.integration.aggregator.MessageGroupProcessor, org.springframework.beans.factory.BeanFactoryAware
A convenient component to utilize
a
FileSplitter.FileMarker-based aggregation logic.
Implements all three CorrelationStrategy, ReleaseStrategy and MessageGroupProcessor
for runtime optimization.
Delegates to HeaderAttributeCorrelationStrategy with FileHeaders.FILENAME attribute,
FileMarkerReleaseStrategy and FileAggregatingMessageGroupProcessor, respectively.
The default FileSplitter behavior
with markers enabled is about do not provide a sequence details
headers, therefore correlation in this aggregator implementation is done by the FileHeaders.FILENAME
header which is still populated by the FileSplitter
for each line emitted, including FileSplitter.FileMarker messages.
If default behavior of this component does not satisfy the target logic, it is recommended to configure an aggregator with individual strategies.
- Since:
- 5.5
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanRelease(org.springframework.integration.store.MessageGroup group) getCorrelationKey(org.springframework.messaging.Message<?> message) BiFunction<org.springframework.messaging.Message<?>,String, String> processMessageGroup(org.springframework.integration.store.MessageGroup group) voidsetBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
-
Constructor Details
-
FileAggregator
public FileAggregator()
-
-
Method Details
-
setBeanFactory
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException - Specified by:
setBeanFactoryin interfaceorg.springframework.beans.factory.BeanFactoryAware- Throws:
org.springframework.beans.BeansException
-
getCorrelationKey
- Specified by:
getCorrelationKeyin interfaceorg.springframework.integration.aggregator.CorrelationStrategy
-
canRelease
public boolean canRelease(org.springframework.integration.store.MessageGroup group) - Specified by:
canReleasein interfaceorg.springframework.integration.aggregator.ReleaseStrategy
-
getGroupConditionSupplier
public BiFunction<org.springframework.messaging.Message<?>,String, getGroupConditionSupplier()String> - Specified by:
getGroupConditionSupplierin interfaceorg.springframework.integration.aggregator.GroupConditionProvider
-
processMessageGroup
- Specified by:
processMessageGroupin interfaceorg.springframework.integration.aggregator.MessageGroupProcessor
-