Package org.apache.camel.processor
Class DynamicRouter
java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.support.AsyncProcessorSupport
org.apache.camel.processor.RoutingSlip
org.apache.camel.processor.DynamicRouter
- All Implemented Interfaces:
AutoCloseable,org.apache.camel.AsyncProcessor,org.apache.camel.Processor,org.apache.camel.Service,org.apache.camel.ShutdownableService,org.apache.camel.spi.HasId,org.apache.camel.spi.IdAware,org.apache.camel.spi.RouteIdAware,org.apache.camel.StatefulService,org.apache.camel.SuspendableService,org.apache.camel.Traceable
Implements a Dynamic Router pattern where the
destination(s) is computed at runtime.
This implementation builds on top of
RoutingSlip which contains the most logic.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.camel.processor.RoutingSlip
RoutingSlip.RoutingSlipIterator -
Field Summary
Fields inherited from class org.apache.camel.processor.RoutingSlip
cacheSize, camelContext, errorHandler, expression, header, id, ignoreInvalidEndpoints, producerCache, routeId, uriDelimiterFields inherited from class org.apache.camel.support.service.BaseService
BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING -
Constructor Summary
ConstructorsConstructorDescriptionDynamicRouter(org.apache.camel.CamelContext camelContext) DynamicRouter(org.apache.camel.CamelContext camelContext, org.apache.camel.Expression expression, String uriDelimiter) -
Method Summary
Modifier and TypeMethodDescriptionprotected RoutingSlip.RoutingSlipIteratorcreateRoutingSlipIterator(org.apache.camel.Exchange exchange, org.apache.camel.Expression expression) Creates the route slip iterator to be used.Methods inherited from class org.apache.camel.processor.RoutingSlip
createErrorHandler, doShutdown, doStart, doStop, getCacheSize, getEndpointUtilizationStatistics, getErrorHandler, getExistingEndpoint, getExpression, getId, getRouteId, getTraceLabel, getUriDelimiter, isIgnoreInvalidEndpoints, newRoutingSlipProcessorForErrorHandler, prepareExchangeForRoutingSlip, prepareRecipient, process, processExchange, resolveEndpoint, setCacheSize, setDelimiter, setErrorHandler, setId, setIgnoreInvalidEndpoints, setRouteId, toStringMethods inherited from class org.apache.camel.support.AsyncProcessorSupport
process, processAsyncMethods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doSuspend, fail, getInternalLock, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.camel.spi.IdAware
setGeneratedIdMethods inherited from interface org.apache.camel.Service
build, close, init, start, stopMethods inherited from interface org.apache.camel.ShutdownableService
shutdownMethods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspendingMethods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Constructor Details
-
DynamicRouter
public DynamicRouter(org.apache.camel.CamelContext camelContext) -
DynamicRouter
public DynamicRouter(org.apache.camel.CamelContext camelContext, org.apache.camel.Expression expression, String uriDelimiter)
-
-
Method Details
-
createRoutingSlipIterator
protected RoutingSlip.RoutingSlipIterator createRoutingSlipIterator(org.apache.camel.Exchange exchange, org.apache.camel.Expression expression) throws Exception Description copied from class:RoutingSlipCreates the route slip iterator to be used.- Overrides:
createRoutingSlipIteratorin classRoutingSlip- Parameters:
exchange- the exchangeexpression- the expression- Returns:
- the iterator, should never be null
- Throws:
Exception
-