@Deprecated public class BatchProcessor extends ServiceSupport implements AsyncProcessor, Navigate<Processor>, IdAware
Processor
which implements some kind of batch processing.Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_BATCH_SIZE
Deprecated.
|
static long |
DEFAULT_BATCH_TIMEOUT
Deprecated.
|
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
Constructor and Description |
---|
BatchProcessor(CamelContext camelContext,
Processor processor,
Collection<Exchange> collection,
Expression expression)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected void |
doStart()
Deprecated.
Implementations override this method to support customized start/stop.
|
protected void |
doStop()
Deprecated.
Implementations override this method to support customized start/stop.
|
int |
getBatchSize()
Deprecated.
|
long |
getBatchTimeout()
Deprecated.
|
Predicate |
getCompletionPredicate()
Deprecated.
|
ExceptionHandler |
getExceptionHandler()
Deprecated.
|
Expression |
getExpression()
Deprecated.
|
String |
getId()
Deprecated.
Returns the id
|
int |
getOutBatchSize()
Deprecated.
|
Processor |
getProcessor()
Deprecated.
|
boolean |
hasNext()
Deprecated.
Are there more outputs?
Important only invoke this once, as this method do not carry state, and is not intended to be used in a while loop,
but used by a if statement instead.
|
boolean |
isAllowDuplicates()
Deprecated.
|
boolean |
isBatchConsumer()
Deprecated.
|
boolean |
isGroupExchanges()
Deprecated.
|
boolean |
isIgnoreInvalidExchanges()
Deprecated.
|
boolean |
isReverse()
Deprecated.
|
List<Processor> |
next()
Deprecated.
Next group of outputs
Important only invoke this once, as this method do not carry state, and is not intended to be used in a while loop,
but used by a if statement instead.
|
void |
process(Exchange exchange)
Deprecated.
Processes the message exchange
|
boolean |
process(Exchange exchange,
AsyncCallback callback)
Deprecated.
Enqueues an exchange for later batch processing.
|
protected void |
processExchange(Exchange exchange)
Deprecated.
Strategy Method to process an exchange in the batch.
|
void |
setAllowDuplicates(boolean allowDuplicates)
Deprecated.
|
void |
setBatchConsumer(boolean batchConsumer)
Deprecated.
|
void |
setBatchSize(int batchSize)
Deprecated.
Sets the in batch size.
|
void |
setBatchTimeout(long batchTimeout)
Deprecated.
|
void |
setCompletionPredicate(Predicate completionPredicate)
Deprecated.
|
void |
setExceptionHandler(ExceptionHandler exceptionHandler)
Deprecated.
|
void |
setGroupExchanges(boolean groupExchanges)
Deprecated.
|
void |
setId(String id)
Deprecated.
Sets the id
|
void |
setIgnoreInvalidExchanges(boolean ignoreInvalidExchanges)
Deprecated.
|
void |
setOutBatchSize(int outBatchSize)
Deprecated.
Sets the out batch size.
|
void |
setReverse(boolean reverse)
Deprecated.
|
String |
toString()
Deprecated.
|
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
public static final long DEFAULT_BATCH_TIMEOUT
public static final int DEFAULT_BATCH_SIZE
public BatchProcessor(CamelContext camelContext, Processor processor, Collection<Exchange> collection, Expression expression)
public Expression getExpression()
public ExceptionHandler getExceptionHandler()
public void setExceptionHandler(ExceptionHandler exceptionHandler)
public int getBatchSize()
public void setBatchSize(int batchSize)
DEFAULT_BATCH_SIZE
.batchSize
- the sizepublic int getOutBatchSize()
public void setOutBatchSize(int outBatchSize)
outBatchSize
- the sizepublic long getBatchTimeout()
public void setBatchTimeout(long batchTimeout)
public boolean isGroupExchanges()
public void setGroupExchanges(boolean groupExchanges)
public boolean isBatchConsumer()
public void setBatchConsumer(boolean batchConsumer)
public boolean isIgnoreInvalidExchanges()
public void setIgnoreInvalidExchanges(boolean ignoreInvalidExchanges)
public boolean isReverse()
public void setReverse(boolean reverse)
public boolean isAllowDuplicates()
public void setAllowDuplicates(boolean allowDuplicates)
public Predicate getCompletionPredicate()
public void setCompletionPredicate(Predicate completionPredicate)
public Processor getProcessor()
public List<Processor> next()
Navigate
public boolean hasNext()
Navigate
public void setId(String id)
IdAware
protected void processExchange(Exchange exchange) throws Exception
Exception
protected void doStart() throws Exception
ServiceSupport
ServiceSupport.doStop()
for more details.doStart
in class ServiceSupport
Exception
ServiceSupport.doStop()
protected void doStop() throws Exception
ServiceSupport
ServiceSupport.doStop()
method when
the service is being stopped. This method will also be invoked
if the service is still in uninitialized state (eg has not
been started). The method is always called to allow the service
to do custom logic when the service is being stopped, such as when
CamelContext
is shutting down.doStop
in class ServiceSupport
Exception
ServiceSupport.doStart()
public void process(Exchange exchange) throws Exception
Processor
public boolean process(Exchange exchange, AsyncCallback callback)
process
in interface AsyncProcessor
exchange
- the message exchangecallback
- the AsyncCallback
will be invoked when the processing of the exchange is completed.
If the exchange is completed synchronously, then the callback is also invoked synchronously.
The callback should therefore be careful of starting recursive loop.Apache Camel