@ManagedResource(description="Managed SedaEndpoint")
@UriEndpoint(firstVersion="1.1.0",
scheme="seda",
title="SEDA",
syntax="seda:name",
label="core,endpoint")
public class SedaEndpoint
extends org.apache.camel.support.DefaultEndpoint
implements org.apache.camel.AsyncEndpoint, org.apache.camel.spi.BrowsableEndpoint, org.apache.camel.MultipleConsumersSupport
| Constructor and Description |
|---|
SedaEndpoint() |
SedaEndpoint(String endpointUri,
org.apache.camel.Component component,
BlockingQueue<org.apache.camel.Exchange> queue) |
SedaEndpoint(String endpointUri,
org.apache.camel.Component component,
BlockingQueue<org.apache.camel.Exchange> queue,
int concurrentConsumers) |
SedaEndpoint(String endpointUri,
org.apache.camel.Component component,
BlockingQueueFactory<org.apache.camel.Exchange> queueFactory,
int concurrentConsumers) |
| Modifier and Type | Method and Description |
|---|---|
org.apache.camel.Consumer |
createConsumer(org.apache.camel.Processor processor) |
protected SedaConsumer |
createNewConsumer(org.apache.camel.Processor processor) |
org.apache.camel.PollingConsumer |
createPollingConsumer() |
org.apache.camel.Producer |
createProducer() |
protected BlockingQueue<org.apache.camel.Exchange> |
createQueue() |
protected void |
doShutdown() |
protected void |
doStart() |
SedaComponent |
getComponent() |
int |
getConcurrentConsumers() |
protected org.apache.camel.AsyncProcessor |
getConsumerMulticastProcessor() |
Set<SedaConsumer> |
getConsumers()
Returns the current active consumers on this endpoint
|
int |
getCurrentQueueSize() |
List<org.apache.camel.Exchange> |
getExchanges()
Returns the current pending exchanges
|
long |
getOfferTimeout() |
int |
getPollTimeout() |
Set<SedaProducer> |
getProducers()
Returns the current active producers on this endpoint
|
BlockingQueue<org.apache.camel.Exchange> |
getQueue() |
QueueReference |
getQueueReference()
Get's the
QueueReference for the this endpoint. |
int |
getSize() |
long |
getTimeout() |
org.apache.camel.WaitForTaskToComplete |
getWaitForTaskToComplete() |
boolean |
hasConsumers() |
boolean |
isBlockWhenFull() |
boolean |
isDiscardIfNoConsumers() |
boolean |
isFailIfNoConsumers() |
boolean |
isLimitConcurrentConsumers() |
boolean |
isMultipleConsumers() |
boolean |
isMultipleConsumersSupported() |
boolean |
isPurgeWhenStopping() |
void |
purgeQueue()
Purges the queue
|
void |
setBlockWhenFull(boolean blockWhenFull)
Whether a thread that sends messages to a full SEDA queue will block until the queue's capacity is no longer exhausted.
|
void |
setConcurrentConsumers(int concurrentConsumers)
Number of concurrent threads processing exchanges.
|
void |
setDiscardIfNoConsumers(boolean discardIfNoConsumers)
Whether the producer should discard the message (do not add the message to the queue), when sending to a queue with no active consumers.
|
void |
setFailIfNoConsumers(boolean failIfNoConsumers)
Whether the producer should fail by throwing an exception, when sending to a queue with no active consumers.
|
void |
setLimitConcurrentConsumers(boolean limitConcurrentConsumers)
Whether to limit the number of concurrentConsumers to the maximum of 500.
|
void |
setMultipleConsumers(boolean multipleConsumers)
Specifies whether multiple consumers are allowed.
|
void |
setOfferTimeout(long offerTimeout)
offerTimeout (in milliseconds) can be added to the block case when queue is full.
|
void |
setPollTimeout(int pollTimeout)
The timeout used when polling.
|
void |
setPurgeWhenStopping(boolean purgeWhenStopping)
Whether to purge the task queue when stopping the consumer/route.
|
void |
setQueue(BlockingQueue<org.apache.camel.Exchange> queue)
Define the queue instance which will be used by the endpoint.
|
void |
setSize(int size)
The maximum capacity of the SEDA queue (i.e., the number of messages it can hold).
|
void |
setTimeout(long timeout)
Timeout (in milliseconds) before a SEDA producer will stop waiting for an asynchronous task to complete.
|
void |
setWaitForTaskToComplete(org.apache.camel.WaitForTaskToComplete waitForTaskToComplete)
Option to specify whether the caller should wait for the async task to complete or not before continuing.
|
void |
shutdown() |
void |
stop() |
protected void |
updateMulticastProcessor() |
configureConsumer, configurePollingConsumer, configureProperties, createAsyncProducer, createEndpointUri, createExchange, createExchange, doInit, doStop, equals, getCamelContext, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isBasicPropertyBinding, isBridgeErrorHandler, isLazyStartProducer, isLenientProperties, isPollingConsumerBlockWhenFull, isSingleton, isSynchronous, setBasicPropertyBinding, setBridgeErrorHandler, setCamelContext, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerQueueSize, setProperties, setSynchronous, toStringbuild, doBuild, doResume, doSuspend, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, start, suspendclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic SedaEndpoint()
public SedaEndpoint(String endpointUri, org.apache.camel.Component component, BlockingQueue<org.apache.camel.Exchange> queue)
public SedaEndpoint(String endpointUri, org.apache.camel.Component component, BlockingQueue<org.apache.camel.Exchange> queue, int concurrentConsumers)
public SedaEndpoint(String endpointUri, org.apache.camel.Component component, BlockingQueueFactory<org.apache.camel.Exchange> queueFactory, int concurrentConsumers)
public SedaComponent getComponent()
getComponent in class org.apache.camel.support.DefaultEndpointpublic org.apache.camel.Producer createProducer()
throws Exception
createProducer in interface org.apache.camel.EndpointExceptionpublic org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor)
throws Exception
createConsumer in interface org.apache.camel.EndpointExceptionprotected SedaConsumer createNewConsumer(org.apache.camel.Processor processor)
public org.apache.camel.PollingConsumer createPollingConsumer()
throws Exception
createPollingConsumer in interface org.apache.camel.EndpointcreatePollingConsumer in class org.apache.camel.support.DefaultEndpointExceptionpublic BlockingQueue<org.apache.camel.Exchange> getQueue()
protected BlockingQueue<org.apache.camel.Exchange> createQueue()
public QueueReference getQueueReference()
QueueReference for the this endpoint.protected org.apache.camel.AsyncProcessor getConsumerMulticastProcessor()
throws Exception
Exceptionprotected void updateMulticastProcessor()
throws Exception
Exceptionpublic void setQueue(BlockingQueue<org.apache.camel.Exchange> queue)
@ManagedAttribute(description="Queue max capacity") public int getSize()
public void setSize(int size)
@ManagedAttribute(description="Current queue size") public int getCurrentQueueSize()
public void setBlockWhenFull(boolean blockWhenFull)
@ManagedAttribute(description="Whether the caller will block sending to a full queue") public boolean isBlockWhenFull()
public void setConcurrentConsumers(int concurrentConsumers)
@ManagedAttribute(description="Number of concurrent consumers") public int getConcurrentConsumers()
@ManagedAttribute public boolean isLimitConcurrentConsumers()
public void setLimitConcurrentConsumers(boolean limitConcurrentConsumers)
public org.apache.camel.WaitForTaskToComplete getWaitForTaskToComplete()
public void setWaitForTaskToComplete(org.apache.camel.WaitForTaskToComplete waitForTaskToComplete)
@ManagedAttribute public long getTimeout()
public void setTimeout(long timeout)
@ManagedAttribute public long getOfferTimeout()
public void setOfferTimeout(long offerTimeout)
@ManagedAttribute public boolean isFailIfNoConsumers()
public void setFailIfNoConsumers(boolean failIfNoConsumers)
@ManagedAttribute public boolean isDiscardIfNoConsumers()
public void setDiscardIfNoConsumers(boolean discardIfNoConsumers)
@ManagedAttribute public boolean isMultipleConsumers()
public void setMultipleConsumers(boolean multipleConsumers)
@ManagedAttribute public int getPollTimeout()
public void setPollTimeout(int pollTimeout)
@ManagedAttribute public boolean isPurgeWhenStopping()
public void setPurgeWhenStopping(boolean purgeWhenStopping)
public List<org.apache.camel.Exchange> getExchanges()
getExchanges in interface org.apache.camel.spi.BrowsableEndpoint@ManagedAttribute public boolean isMultipleConsumersSupported()
isMultipleConsumersSupported in interface org.apache.camel.MultipleConsumersSupport@ManagedOperation(description="Purges the seda queue") public void purgeQueue()
public Set<SedaConsumer> getConsumers()
public Set<SedaProducer> getProducers()
public boolean hasConsumers()
protected void doStart()
throws Exception
doStart in class org.apache.camel.support.DefaultEndpointExceptionpublic void stop()
stop in interface org.apache.camel.Servicestop in class org.apache.camel.support.service.ServiceSupportpublic void shutdown()
shutdown in interface org.apache.camel.ShutdownableServiceshutdown in class org.apache.camel.support.service.ServiceSupportApache Camel