Package org.apache.camel.component.stub
Class StubEndpoint
java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.support.DefaultEndpoint
org.apache.camel.component.seda.SedaEndpoint
org.apache.camel.component.stub.StubEndpoint
- All Implemented Interfaces:
AutoCloseable,org.apache.camel.AsyncEndpoint,org.apache.camel.CamelContextAware,org.apache.camel.ComponentAware,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.HasCamelContext,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},
lenientProperties=true)
public class StubEndpoint
extends org.apache.camel.component.seda.SedaEndpoint
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 Seda endpoints. The main
difference between Stub and Seda is that Seda will validate the URI and parameters you give it, so putting seda: 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
ConstructorsConstructorDescriptionStubEndpoint(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
Modifier and TypeMethodDescriptionprotected StubConsumercreateNewConsumer(org.apache.camel.Processor processor) org.apache.camel.ProducerMethods inherited from class org.apache.camel.component.seda.SedaEndpoint
createConsumer, createPollingConsumer, createQueue, doInit, doShutdown, doStart, getComponent, getConcurrentConsumers, getConsumerMulticastProcessor, getConsumers, getCurrentQueueSize, getExchanges, getName, 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, updateMulticastProcessorMethods inherited from class org.apache.camel.support.DefaultEndpoint
configureConsumer, configureExchange, configurePollingConsumer, configureProperties, createAsyncProducer, createEndpointUri, createExchange, createExchange, equals, getCamelContext, 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, doStop, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, start, suspendMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.camel.ComponentAware
getComponent, setComponentMethods inherited from interface org.apache.camel.Endpoint
configureExchange, configureProperties, createAsyncProducer, createExchange, createExchange, getCamelContext, getEndpointBaseUri, getEndpointKey, getEndpointUri, getExchangePattern, isLenientProperties, isSingletonProducer, setCamelContextMethods inherited from interface org.apache.camel.IsSingleton
isSingletonMethods inherited from interface org.apache.camel.Service
build, close, init, startMethods 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
-
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 Details
-
createNewConsumer
- Overrides:
createNewConsumerin classorg.apache.camel.component.seda.SedaEndpoint
-
createProducer
- Specified by:
createProducerin interfaceorg.apache.camel.Endpoint- Overrides:
createProducerin classorg.apache.camel.component.seda.SedaEndpoint- Throws:
Exception
-