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 java.lang.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 Constructor Description FileAggregator() -
Method Summary
Modifier and Type Method Description booleancanRelease(org.springframework.integration.store.MessageGroup group)java.lang.ObjectgetCorrelationKey(org.springframework.messaging.Message<?> message)java.util.function.BiFunction<org.springframework.messaging.Message<?>,java.lang.String,java.lang.String>getGroupConditionSupplier()java.lang.ObjectprocessMessageGroup(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
public java.lang.Object getCorrelationKey(org.springframework.messaging.Message<?> message)- 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 java.util.function.BiFunction<org.springframework.messaging.Message<?>,java.lang.String,java.lang.String> getGroupConditionSupplier()- Specified by:
getGroupConditionSupplierin interfaceorg.springframework.integration.aggregator.GroupConditionProvider
-
processMessageGroup
public java.lang.Object processMessageGroup(org.springframework.integration.store.MessageGroup group)- Specified by:
processMessageGroupin interfaceorg.springframework.integration.aggregator.MessageGroupProcessor
-