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 RouterEndpointfor 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.ConsumercreateConsumer(org.apache.camel.Processor processor) This is a producer-only component.org.apache.camel.ProducerCalls theDynamicRouterProducer.DynamicRouterProducerFactoryto create aDynamicRouterProducerinstance.protected voiddoInit()Initialize the endpoint by creating (and adding) theDynamicRouterProcessorinstance.Gets theDynamicRouterConfiguration.A convenience method that wraps the parent method and casts to theDynamicRouterComponentimplementation.booleanisRemote()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, toStringMethods 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, suspendMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.camel.ComponentAware
getComponentMethods inherited from interface org.apache.camel.Endpoint
getEndpointBaseUri, isSingletonProducerMethods 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
-
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 RouterEndpointfor the given endpoint URI. This includes the creation of aDynamicRouterProcessorthat is registered with the suppliedDynamicRouterComponent.- Parameters:
uri- the endpoint URIcomponent- the Dynamic RouterComponentconfiguration- theDynamicRouterConfigurationprocessorFactorySupplier- creates theDynamicRouterProcessorproducerFactorySupplier- creates theDynamicRouterProcessorrecipientListSupplier- creates theRecipientListfilterService- 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 RouterComponentconfiguration- theDynamicRouterConfigurationfilterService- theDynamicRouterFilterService
-
-
Method Details
-
isRemote
public boolean isRemote() -
doInit
Initialize the endpoint by creating (and adding) theDynamicRouterProcessorinstance.- Overrides:
doInitin classorg.apache.camel.support.DefaultEndpoint- Throws:
Exception- if there is a problem getting theDynamicRouterProcessorinstance through theprocessorFactorySupplier
-
createProducer
public org.apache.camel.Producer createProducer()Calls theDynamicRouterProducer.DynamicRouterProducerFactoryto create aDynamicRouterProducerinstance.- Returns:
- a
DynamicRouterProducerinstance
-
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 theDynamicRouterComponentimplementation.- Returns:
- the
DynamicRouterComponent
-
getConfiguration
Gets theDynamicRouterConfiguration.- Returns:
- the
DynamicRouterConfiguration
-