public class DefaultBatchStepAggregator extends org.mule.runtime.core.api.processor.AbstractMessageProcessorOwner implements BatchStepAggregator
A semi-transactional boundary in which records are aggregated and processed as a block instead of a Record by
Record basis.
This component has two modes of operation:
BulkOperationResultBatchJobInstance are exposed through an Iterator so that they can all be
processed together. Although this Iterator has streaming capabilities and is able to handle millions of records without
running out of memory, you should be careful not to use any stateful components that might generate an
OutOfMemoryError. Streaming aggregators "have an all or nothing" error handling policy. If one record fails,
all records will be failed. Also, no record will be exposed to the next step until all of them have been processed by this
aggregatorlocator, logger, muleContext| Constructor and Description |
|---|
DefaultBatchStepAggregator() |
| Modifier and Type | Method and Description |
|---|---|
int |
add(Record record,
BatchTransactionContext ctx)
Adds a new record
|
void |
flush(BatchJobInstanceAdapter jobInstance)
Flushes the buffered
Records for the given
BatchJobInstanceAdapter. |
protected List<org.mule.runtime.core.api.processor.Processor> |
getOwnedMessageProcessors() |
Integer |
getSize() |
void |
initialise() |
boolean |
isStreaming() |
void |
releaseResources(BatchJobInstanceAdapter jobInstance)
Use this method when processing for the given
BatchJobInstanceAdapter should stop and thus any allocated resources
related to it should be freed. |
void |
setBatchEngine(BatchEngine batchEngine) |
void |
setExceptionReporter(StepExceptionReporter exceptionReporter)
Allows to customize how the exceptions are reported
|
void |
setMessageProcessors(List<org.mule.runtime.core.api.processor.Processor> messageProcessors) |
void |
setNotificationDispatcher(org.mule.runtime.api.notification.NotificationDispatcher notificationDispatcher) |
void |
setPreserveMimeTypes(boolean preserveMimeTypes) |
void |
setSize(Integer size) |
void |
setStep(BatchStepAdapter step) |
void |
setStreaming(boolean streaming) |
long |
size(BatchJobInstanceAdapter jobInstance) |
getOwnedObjectsdispose, getMuleContext, setMuleContext, start, stopgetAnnotation, getAnnotations, getDslSource, getIdentifier, getLocation, getRepresentation, getRootContainerLocation, initRootContainerName, setAnnotationspublic void initialise()
throws org.mule.runtime.api.lifecycle.InitialisationException
initialise in interface org.mule.runtime.api.lifecycle.Initialisableinitialise in class org.mule.runtime.core.api.processor.AbstractMuleObjectOwner<org.mule.runtime.core.api.processor.Processor>org.mule.runtime.api.lifecycle.InitialisationExceptionpublic void flush(BatchJobInstanceAdapter jobInstance)
BatchStepAggregatorRecords for the given
BatchJobInstanceAdapter.
Use this method when you want to flush the info but you still expect more records from the same job instance to come. In this
way, you flush the records but you avoid constantly recreating the internal tracking information.flush in interface BatchStepAggregatorjobInstance - job to be flushed.public void releaseResources(BatchJobInstanceAdapter jobInstance)
BatchStepAggregatorBatchJobInstanceAdapter should stop and thus any allocated resources
related to it should be freed.releaseResources in interface BatchStepAggregatorjobInstance - a BatchJobInstanceAdapterpublic int add(Record record, BatchTransactionContext ctx)
BatchStepAggregatoradd in interface BatchStepAggregatorrecord - record to add.ctx - the tx context that is being used for this work run.public long size(BatchJobInstanceAdapter jobInstance)
size in interface BatchStepAggregatorjobInstance - job for which the size is consultedprotected List<org.mule.runtime.core.api.processor.Processor> getOwnedMessageProcessors()
getOwnedMessageProcessors in class org.mule.runtime.core.api.processor.AbstractMessageProcessorOwnerpublic void setMessageProcessors(List<org.mule.runtime.core.api.processor.Processor> messageProcessors)
public void setSize(Integer size)
public boolean isStreaming()
isStreaming in interface BatchStepAggregatorfalse otherwisepublic void setStreaming(boolean streaming)
public void setPreserveMimeTypes(boolean preserveMimeTypes)
public Integer getSize()
getSize in interface BatchStepAggregatorpublic void setStep(BatchStepAdapter step)
public void setBatchEngine(BatchEngine batchEngine)
public void setExceptionReporter(StepExceptionReporter exceptionReporter)
BatchStepAggregatorsetExceptionReporter in interface BatchStepAggregatorexceptionReporter - exception reporter to configure on the aggregatorpublic void setNotificationDispatcher(org.mule.runtime.api.notification.NotificationDispatcher notificationDispatcher)
Copyright © 2006–2022 MuleSoft, Inc.. All rights reserved.