Class DisruptorComponent
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.support.DefaultComponent
-
- org.apache.camel.component.disruptor.DisruptorComponent
-
- All Implemented Interfaces:
AutoCloseable
,org.apache.camel.CamelContextAware
,org.apache.camel.Component
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.StatefulService
,org.apache.camel.SuspendableService
- Direct Known Subclasses:
DisruptorVmComponent
@Component("disruptor") public class DisruptorComponent extends org.apache.camel.support.DefaultComponent
An implementation of the Disruptor component for asynchronous SEDA exchanges on an LMAX Disruptor within a CamelContext
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_BUFFER_SIZE
static int
MAX_CONCURRENT_CONSUMERS
-
Constructor Summary
Constructors Constructor Description DisruptorComponent()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.apache.camel.Endpoint
createEndpoint(String uri, String remaining, Map<String,Object> parameters)
protected void
doStop()
int
getBufferSize()
int
getDefaultConcurrentConsumers()
DisruptorProducerType
getDefaultProducerType()
DisruptorWaitStrategy
getDefaultWaitStrategy()
static String
getDisruptorKey(String uri)
Map<String,DisruptorReference>
getDisruptors()
boolean
isDefaultBlockWhenFull()
boolean
isDefaultMultipleConsumers()
void
onShutdownEndpoint(DisruptorEndpoint disruptorEndpoint)
void
setBufferSize(int size)
To configure the ring buffer sizevoid
setDefaultBlockWhenFull(boolean defaultBlockWhenFull)
To configure the default value for block when fullvoid
setDefaultConcurrentConsumers(int defaultConcurrentConsumers)
To configure the default number of concurrent consumersvoid
setDefaultMultipleConsumers(boolean defaultMultipleConsumers)
To configure the default value for multiple consumersvoid
setDefaultProducerType(DisruptorProducerType defaultProducerType)
To configure the default value for DisruptorProducerTypevoid
setDefaultWaitStrategy(DisruptorWaitStrategy defaultWaitStrategy)
To configure the default value for DisruptorWaitStrategy-
Methods inherited from class org.apache.camel.support.DefaultComponent
afterConfiguration, createEndpoint, createEndpoint, doBuild, doInit, doStart, getAndRemoveOrResolveReferenceParameter, getAndRemoveOrResolveReferenceParameter, getAndRemoveParameter, getAndRemoveParameter, getCamelContext, getComponentPropertyConfigurer, getEndpointPropertyConfigurer, getExtension, getSupportedExtensions, ifStartsWithReturnRemainder, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, registerExtension, registerExtension, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceParameter, resolveAndRemoveReferenceParameter, resolveRawParameterValues, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setLazyStartProducer, setProperties, setProperties, setProperties, useIntrospectionOnEndpoint, useRawUri, validateParameters, validateURI
-
Methods inherited from class org.apache.camel.support.service.BaseService
build, doFail, doLifecycleChange, doResume, doShutdown, doSuspend, fail, 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, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Field Detail
-
DEFAULT_BUFFER_SIZE
public static final int DEFAULT_BUFFER_SIZE
- See Also:
- Constant Field Values
-
MAX_CONCURRENT_CONSUMERS
public static final int MAX_CONCURRENT_CONSUMERS
- See Also:
- Constant Field Values
-
-
Method Detail
-
createEndpoint
protected org.apache.camel.Endpoint createEndpoint(String uri, String remaining, Map<String,Object> parameters) throws Exception
- Specified by:
createEndpoint
in classorg.apache.camel.support.DefaultComponent
- Throws:
Exception
-
doStop
protected void doStop() throws Exception
- Overrides:
doStop
in classorg.apache.camel.support.DefaultComponent
- Throws:
Exception
-
getDisruptors
public Map<String,DisruptorReference> getDisruptors()
-
getDefaultConcurrentConsumers
public int getDefaultConcurrentConsumers()
-
setDefaultConcurrentConsumers
public void setDefaultConcurrentConsumers(int defaultConcurrentConsumers)
To configure the default number of concurrent consumers
-
isDefaultMultipleConsumers
public boolean isDefaultMultipleConsumers()
-
setDefaultMultipleConsumers
public void setDefaultMultipleConsumers(boolean defaultMultipleConsumers)
To configure the default value for multiple consumers
-
getDefaultProducerType
public DisruptorProducerType getDefaultProducerType()
-
setDefaultProducerType
public void setDefaultProducerType(DisruptorProducerType defaultProducerType)
To configure the default value for DisruptorProducerType The default value is Multi.
-
getDefaultWaitStrategy
public DisruptorWaitStrategy getDefaultWaitStrategy()
-
setDefaultWaitStrategy
public void setDefaultWaitStrategy(DisruptorWaitStrategy defaultWaitStrategy)
To configure the default value for DisruptorWaitStrategy The default value is Blocking.
-
isDefaultBlockWhenFull
public boolean isDefaultBlockWhenFull()
-
setDefaultBlockWhenFull
public void setDefaultBlockWhenFull(boolean defaultBlockWhenFull)
To configure the default value for block when full The default value is true.
-
setBufferSize
public void setBufferSize(int size)
To configure the ring buffer size
-
getBufferSize
public int getBufferSize()
-
onShutdownEndpoint
public void onShutdownEndpoint(DisruptorEndpoint disruptorEndpoint)
-
-