Class DynamicRouterEndpoint
java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.support.DefaultEndpoint
org.apache.camel.component.dynamicrouter.routing.DynamicRouterEndpoint
- All Implemented Interfaces:
AutoCloseable
,org.apache.camel.CamelContextAware
,org.apache.camel.ComponentAware
,org.apache.camel.Endpoint
,org.apache.camel.IsSingleton
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.spi.HasCamelContext
,org.apache.camel.spi.HasId
,org.apache.camel.StatefulService
,org.apache.camel.SuspendableService
@UriEndpoint(firstVersion="3.15.0",
scheme="dynamic-router",
title="Dynamic Router",
syntax="dynamic-router:channel",
producerOnly=true,
remote=false,
category={MESSAGING,CORE})
public class DynamicRouterEndpoint
extends org.apache.camel.support.DefaultEndpoint
The Dynamic Router component routes exchanges to recipients, and the recipients (and their rules) may change at
runtime.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields 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
ConstructorsConstructorDescriptionDynamicRouterEndpoint
(String uri, DynamicRouterComponent component, DynamicRouterConfiguration configuration, Supplier<DynamicRouterProcessor.DynamicRouterProcessorFactory> processorFactorySupplier, Supplier<DynamicRouterProducer.DynamicRouterProducerFactory> producerFactorySupplier, BiFunction<org.apache.camel.CamelContext, org.apache.camel.Expression, org.apache.camel.processor.RecipientList> recipientListSupplier, DynamicRouterFilterService filterService) Create the Dynamic RouterEndpoint
for the given endpoint URI.DynamicRouterEndpoint
(String uri, DynamicRouterComponent component, DynamicRouterConfiguration configuration, DynamicRouterFilterService filterService) Create the specialized endpoint for the Dynamic Router Control Channel. -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.camel.Consumer
createConsumer
(org.apache.camel.Processor processor) This is a producer-only component.org.apache.camel.Producer
Calls theDynamicRouterProducer.DynamicRouterProducerFactory
to create aDynamicRouterProducer
instance.protected void
doInit()
Initialize the endpoint by creating (and adding) theDynamicRouterProcessor
instance.Gets theDynamicRouterConfiguration
.A convenience method that wraps the parent method and casts to theDynamicRouterComponent
implementation.boolean
isRemote()
Methods inherited from class org.apache.camel.support.DefaultEndpoint
configureConsumer, configureExchange, configurePollingConsumer, configureProperties, createAsyncProducer, createEndpointUri, createExchange, createExchange, createPollingConsumer, equals, getCamelContext, getComponent, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, isLenientProperties, isPollingConsumerBlockWhenFull, isPollingConsumerCopy, isSingleton, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerCopy, setPollingConsumerQueueSize, setProperties, toString
Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doStart, doStop, doSuspend, fail, getInternalLock, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.camel.ComponentAware
getComponent
Methods inherited from interface org.apache.camel.Endpoint
getEndpointBaseUri, isSingletonProducer
Methods inherited from interface org.apache.camel.Service
build, close, init, start, stop
Methods inherited from interface org.apache.camel.ShutdownableService
shutdown
Methods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending
Methods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Constructor Details
-
DynamicRouterEndpoint
public DynamicRouterEndpoint(String uri, DynamicRouterComponent component, DynamicRouterConfiguration configuration, Supplier<DynamicRouterProcessor.DynamicRouterProcessorFactory> processorFactorySupplier, Supplier<DynamicRouterProducer.DynamicRouterProducerFactory> producerFactorySupplier, BiFunction<org.apache.camel.CamelContext, org.apache.camel.Expression, org.apache.camel.processor.RecipientList> recipientListSupplier, DynamicRouterFilterService filterService) Create the Dynamic RouterEndpoint
for the given endpoint URI. This includes the creation of aDynamicRouterProcessor
that is registered with the suppliedDynamicRouterComponent
.- Parameters:
uri
- the endpoint URIcomponent
- the Dynamic RouterComponent
configuration
- theDynamicRouterConfiguration
processorFactorySupplier
- creates theDynamicRouterProcessor
producerFactorySupplier
- creates theDynamicRouterProcessor
recipientListSupplier
- creates theRecipientList
filterService
- theDynamicRouterFilterService
-
DynamicRouterEndpoint
public DynamicRouterEndpoint(String uri, DynamicRouterComponent component, DynamicRouterConfiguration configuration, DynamicRouterFilterService filterService) Create the specialized endpoint for the Dynamic Router Control Channel.- Parameters:
uri
- the endpoint URIcomponent
- the Dynamic RouterComponent
configuration
- theDynamicRouterConfiguration
filterService
- theDynamicRouterFilterService
-
-
Method Details
-
isRemote
public boolean isRemote() -
doInit
Initialize the endpoint by creating (and adding) theDynamicRouterProcessor
instance.- Overrides:
doInit
in classorg.apache.camel.support.DefaultEndpoint
- Throws:
Exception
- if there is a problem getting theDynamicRouterProcessor
instance through theprocessorFactorySupplier
-
createProducer
public org.apache.camel.Producer createProducer()Calls theDynamicRouterProducer.DynamicRouterProducerFactory
to create aDynamicRouterProducer
instance.- Returns:
- a
DynamicRouterProducer
instance
-
createConsumer
public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor) This is a producer-only component.- Parameters:
processor
- not applicable to producer-only component- Returns:
- not applicable to producer-only component
-
getDynamicRouterComponent
A convenience method that wraps the parent method and casts to theDynamicRouterComponent
implementation.- Returns:
- the
DynamicRouterComponent
-
getConfiguration
Gets theDynamicRouterConfiguration
.- Returns:
- the
DynamicRouterConfiguration
-