Class StubEndpoint

  • All Implemented Interfaces:
    AutoCloseable, org.apache.camel.AsyncEndpoint, org.apache.camel.CamelContextAware, org.apache.camel.Endpoint, org.apache.camel.IsSingleton, org.apache.camel.MultipleConsumersSupport, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.BrowsableEndpoint, org.apache.camel.spi.HasId, org.apache.camel.StatefulService, org.apache.camel.SuspendableService

    @UriEndpoint(firstVersion="2.10.0",
                 scheme="stub",
                 title="Stub",
                 syntax="stub:name",
                 category={CORE,TESTING})
    public class StubEndpoint
    extends org.apache.camel.component.vm.VmEndpoint
    Stub out any physical endpoints while in development or testing. For example to run a route without needing to actually connect to a specific SMTP or HTTP endpoint. Just add stub: in front of any endpoint URI to stub out the endpoint. Internally the Stub component creates VM endpoints. The main difference between Stub and VM is that VM will validate the URI and parameters you give it, so putting vm: in front of a typical URI with query arguments will usually fail. Stub won't though, as it basically ignores all query parameters to let you quickly stub out one or more endpoints in your route temporarily.
    • 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

      Constructors 
      Constructor Description
      StubEndpoint​(String endpointUri, org.apache.camel.Component component, BlockingQueue<org.apache.camel.Exchange> queue)  
      StubEndpoint​(String endpointUri, org.apache.camel.Component component, BlockingQueue<org.apache.camel.Exchange> queue, int concurrentConsumers)  
      StubEndpoint​(String endpointUri, org.apache.camel.Component component, org.apache.camel.component.seda.BlockingQueueFactory<org.apache.camel.Exchange> queueFactory, int concurrentConsumers)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected StubConsumer createNewConsumer​(org.apache.camel.Processor processor)  
      org.apache.camel.Producer createProducer()  
      • Methods inherited from class org.apache.camel.component.seda.SedaEndpoint

        createConsumer, createPollingConsumer, createQueue, doInit, doShutdown, getComponent, getConcurrentConsumers, getConsumerMulticastProcessor, getConsumers, getCurrentQueueSize, getExchanges, getOfferTimeout, getPollTimeout, getProducers, getQueue, getQueueReference, getSize, getTimeout, getWaitForTaskToComplete, hasConsumers, isBlockWhenFull, isDiscardIfNoConsumers, isDiscardWhenFull, isFailIfNoConsumers, isLimitConcurrentConsumers, isMultipleConsumers, isMultipleConsumersSupported, isPurgeWhenStopping, purgeQueue, setBlockWhenFull, setConcurrentConsumers, setDiscardIfNoConsumers, setDiscardWhenFull, setFailIfNoConsumers, setLimitConcurrentConsumers, setMultipleConsumers, setOfferTimeout, setPollTimeout, setPurgeWhenStopping, setQueue, setSize, setTimeout, setWaitForTaskToComplete, shutdown, stop, updateMulticastProcessor
      • Methods inherited from class org.apache.camel.support.DefaultEndpoint

        configureConsumer, configurePollingConsumer, configureProperties, createAsyncProducer, createEndpointUri, createExchange, createExchange, doStart, doStop, equals, getCamelContext, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, isLenientProperties, isPollingConsumerBlockWhenFull, isSingleton, isSynchronous, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerQueueSize, setProperties, setSynchronous, toString
      • Methods inherited from class org.apache.camel.support.service.BaseService

        build, doBuild, doFail, doLifecycleChange, doResume, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, start, suspend
      • Methods inherited from interface org.apache.camel.Endpoint

        configureProperties, createAsyncProducer, createExchange, createExchange, getCamelContext, getEndpointBaseUri, getEndpointKey, getEndpointUri, isLenientProperties, isSingletonProducer, setCamelContext
      • Methods inherited from interface org.apache.camel.IsSingleton

        isSingleton
      • Methods inherited from interface org.apache.camel.Service

        build, close, init, start
      • 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

      • StubEndpoint

        public StubEndpoint​(String endpointUri,
                            org.apache.camel.Component component,
                            BlockingQueue<org.apache.camel.Exchange> queue)
      • StubEndpoint

        public StubEndpoint​(String endpointUri,
                            org.apache.camel.Component component,
                            BlockingQueue<org.apache.camel.Exchange> queue,
                            int concurrentConsumers)
      • StubEndpoint

        public StubEndpoint​(String endpointUri,
                            org.apache.camel.Component component,
                            org.apache.camel.component.seda.BlockingQueueFactory<org.apache.camel.Exchange> queueFactory,
                            int concurrentConsumers)
    • Method Detail

      • createNewConsumer

        protected StubConsumer createNewConsumer​(org.apache.camel.Processor processor)
        Overrides:
        createNewConsumer in class org.apache.camel.component.vm.VmEndpoint
      • createProducer

        public org.apache.camel.Producer createProducer()
                                                 throws Exception
        Specified by:
        createProducer in interface org.apache.camel.Endpoint
        Overrides:
        createProducer in class org.apache.camel.component.seda.SedaEndpoint
        Throws:
        Exception