public class RecipientListProcessor extends MulticastProcessor
MulticastProcessor which is based on
recipient lists. This implementation have to handle the fact the processors is not known at design time but evaluated
at runtime from the dynamic recipient list. Therefore this implementation have to at runtime lookup endpoints and
create producers which should act as the processors for the multicast processors which runs under the hood. Also this
implementation supports the asynchronous routing engine which makes the code more trickier.MulticastProcessor.MulticastTaskonPrepare| Constructor and Description |
|---|
RecipientListProcessor(org.apache.camel.CamelContext camelContext,
org.apache.camel.Route route,
org.apache.camel.spi.ProducerCache producerCache,
Iterator<?> iter) |
RecipientListProcessor(org.apache.camel.CamelContext camelContext,
org.apache.camel.Route route,
org.apache.camel.spi.ProducerCache producerCache,
Iterator<?> iter,
org.apache.camel.AggregationStrategy aggregationStrategy) |
RecipientListProcessor(org.apache.camel.CamelContext camelContext,
org.apache.camel.Route route,
org.apache.camel.spi.ProducerCache producerCache,
Iterator<?> iter,
org.apache.camel.AggregationStrategy aggregationStrategy,
boolean parallelProcessing,
ExecutorService executorService,
boolean shutdownExecutorService,
boolean streaming,
boolean stopOnException,
long timeout,
org.apache.camel.Processor onPrepare,
boolean shareUnitOfWork,
boolean parallelAggregate,
boolean stopOnAggregateException) |
| Modifier and Type | Method and Description |
|---|---|
protected ProcessorExchangePair |
createProcessorExchangePair(int index,
org.apache.camel.Endpoint endpoint,
org.apache.camel.Producer producer,
org.apache.camel.Exchange exchange,
org.apache.camel.ExchangePattern pattern,
boolean prototypeEndpoint)
This logic is similar to MulticastProcessor but we have to return a RecipientProcessorExchangePair instead
|
protected Iterable<ProcessorExchangePair> |
createProcessorExchangePairs(org.apache.camel.Exchange exchange) |
protected void |
doShutdown() |
protected void |
doStart() |
protected void |
doStop() |
int |
getCacheSize() |
protected static org.apache.camel.Endpoint |
getExistingEndpoint(org.apache.camel.Exchange exchange,
Object recipient) |
String |
getTraceLabel() |
boolean |
isIgnoreInvalidEndpoints() |
protected static Object |
prepareRecipient(org.apache.camel.Exchange exchange,
Object recipient) |
protected static org.apache.camel.Endpoint |
resolveEndpoint(org.apache.camel.Exchange exchange,
Object recipient,
boolean prototype) |
protected org.apache.camel.ExchangePattern |
resolveExchangePattern(Object recipient) |
void |
setCacheSize(int cacheSize) |
void |
setIgnoreInvalidEndpoints(boolean ignoreInvalidEndpoints) |
afterSend, beforeSend, createAggregateExecutorService, createErrorHandler, createProcessorExchangePair, createUnitOfWorkProcessor, doAggregate, doDone, doInit, getAggregateExecutorService, getAggregationStrategy, getAggregationStrategy, getCamelContext, getExchangeIndex, getId, getProcessors, getRouteId, getTimeout, hasNext, isParallelAggregate, isParallelProcessing, isShareUnitOfWork, isStopOnAggregateException, isStopOnException, isStreaming, next, prepareSharedUnitOfWork, process, removeAggregationStrategyFromExchange, schedule, schedule, setAggregateExecutorService, setAggregationStrategyOnExchange, setId, setRouteId, setToEndpoint, toString, updateNewExchangebuild, doBuild, doFail, doLifecycleChange, doResume, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic RecipientListProcessor(org.apache.camel.CamelContext camelContext,
org.apache.camel.Route route,
org.apache.camel.spi.ProducerCache producerCache,
Iterator<?> iter)
public RecipientListProcessor(org.apache.camel.CamelContext camelContext,
org.apache.camel.Route route,
org.apache.camel.spi.ProducerCache producerCache,
Iterator<?> iter,
org.apache.camel.AggregationStrategy aggregationStrategy)
public RecipientListProcessor(org.apache.camel.CamelContext camelContext,
org.apache.camel.Route route,
org.apache.camel.spi.ProducerCache producerCache,
Iterator<?> iter,
org.apache.camel.AggregationStrategy aggregationStrategy,
boolean parallelProcessing,
ExecutorService executorService,
boolean shutdownExecutorService,
boolean streaming,
boolean stopOnException,
long timeout,
org.apache.camel.Processor onPrepare,
boolean shareUnitOfWork,
boolean parallelAggregate,
boolean stopOnAggregateException)
public int getCacheSize()
public void setCacheSize(int cacheSize)
public boolean isIgnoreInvalidEndpoints()
public void setIgnoreInvalidEndpoints(boolean ignoreInvalidEndpoints)
protected Iterable<ProcessorExchangePair> createProcessorExchangePairs(org.apache.camel.Exchange exchange) throws Exception
createProcessorExchangePairs in class MulticastProcessorExceptionprotected ProcessorExchangePair createProcessorExchangePair(int index, org.apache.camel.Endpoint endpoint, org.apache.camel.Producer producer, org.apache.camel.Exchange exchange, org.apache.camel.ExchangePattern pattern, boolean prototypeEndpoint)
protected static Object prepareRecipient(org.apache.camel.Exchange exchange, Object recipient) throws org.apache.camel.NoTypeConversionAvailableException
org.apache.camel.NoTypeConversionAvailableExceptionprotected static org.apache.camel.Endpoint getExistingEndpoint(org.apache.camel.Exchange exchange,
Object recipient)
protected static org.apache.camel.Endpoint resolveEndpoint(org.apache.camel.Exchange exchange,
Object recipient,
boolean prototype)
protected org.apache.camel.ExchangePattern resolveExchangePattern(Object recipient)
protected void doStart()
throws Exception
doStart in class MulticastProcessorExceptionprotected void doStop()
throws Exception
doStop in class MulticastProcessorExceptionprotected void doShutdown()
throws Exception
doShutdown in class MulticastProcessorExceptionpublic String getTraceLabel()
getTraceLabel in interface org.apache.camel.TraceablegetTraceLabel in class MulticastProcessorApache Camel