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 boolean
canRelease(org.springframework.integration.store.MessageGroup group)
java.lang.Object
getCorrelationKey(org.springframework.messaging.Message<?> message)
java.util.function.BiFunction<org.springframework.messaging.Message<?>,java.lang.String,java.lang.String>
getGroupConditionSupplier()
java.lang.Object
processMessageGroup(org.springframework.integration.store.MessageGroup group)
void
setBeanFactory(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:
setBeanFactory
in interfaceorg.springframework.beans.factory.BeanFactoryAware
- Throws:
org.springframework.beans.BeansException
-
getCorrelationKey
public java.lang.Object getCorrelationKey(org.springframework.messaging.Message<?> message)- Specified by:
getCorrelationKey
in interfaceorg.springframework.integration.aggregator.CorrelationStrategy
-
canRelease
public boolean canRelease(org.springframework.integration.store.MessageGroup group)- Specified by:
canRelease
in interfaceorg.springframework.integration.aggregator.ReleaseStrategy
-
getGroupConditionSupplier
public java.util.function.BiFunction<org.springframework.messaging.Message<?>,java.lang.String,java.lang.String> getGroupConditionSupplier()- Specified by:
getGroupConditionSupplier
in interfaceorg.springframework.integration.aggregator.GroupConditionProvider
-
processMessageGroup
public java.lang.Object processMessageGroup(org.springframework.integration.store.MessageGroup group)- Specified by:
processMessageGroup
in interfaceorg.springframework.integration.aggregator.MessageGroupProcessor
-