Class 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  
      • 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
    • 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 size
      void setDefaultBlockWhenFull​(boolean defaultBlockWhenFull)
      To configure the default value for block when full
      void setDefaultConcurrentConsumers​(int defaultConcurrentConsumers)
      To configure the default number of concurrent consumers
      void setDefaultMultipleConsumers​(boolean defaultMultipleConsumers)
      To configure the default value for multiple consumers
      void setDefaultProducerType​(DisruptorProducerType defaultProducerType)
      To configure the default value for DisruptorProducerType
      void 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 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 Detail

      • DisruptorComponent

        public DisruptorComponent()
    • Method Detail

      • createEndpoint

        protected org.apache.camel.Endpoint createEndpoint​(String uri,
                                                           String remaining,
                                                           Map<String,​Object> parameters)
                                                    throws Exception
        Specified by:
        createEndpoint in class org.apache.camel.support.DefaultComponent
        Throws:
        Exception
      • getDisruptorKey

        public static String getDisruptorKey​(String uri)
      • doStop

        protected void doStop()
                       throws Exception
        Overrides:
        doStop in class org.apache.camel.support.DefaultComponent
        Throws:
        Exception
      • 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
      • setDefaultProducerType

        public void setDefaultProducerType​(DisruptorProducerType defaultProducerType)
        To configure the default value for DisruptorProducerType

        The default value is Multi.

      • 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)