@ManagedResource(description="Managed Disruptor Endpoint") @UriEndpoint(firstVersion="2.12.0", scheme="disruptor,disruptor-vm", title="Disruptor,Disruptor VM", syntax="disruptor:name", consumerClass=DisruptorConsumer.class, label="endpoint") public class DisruptorEndpoint extends org.apache.camel.impl.DefaultEndpoint implements org.apache.camel.AsyncEndpoint, org.apache.camel.MultipleConsumersSupport
Modifier and Type | Field and Description |
---|---|
static String |
DISRUPTOR_IGNORE_EXCHANGE |
Constructor and Description |
---|
DisruptorEndpoint(String endpointUri,
org.apache.camel.Component component,
DisruptorReference disruptorReference,
int concurrentConsumers,
boolean multipleConsumers,
boolean blockWhenFull) |
Modifier and Type | Method and Description |
---|---|
org.apache.camel.Consumer |
createConsumer(org.apache.camel.Processor processor) |
org.apache.camel.Producer |
createProducer() |
protected void |
doShutdown() |
protected void |
doStart() |
protected void |
doStop() |
boolean |
equals(Object object) |
int |
getBufferSize() |
DisruptorComponent |
getComponent() |
int |
getConcurrentConsumers()
Number of concurrent threads processing exchanges.
|
Set<DisruptorConsumer> |
getConsumers()
Returns the current active consumers on this endpoint
|
String |
getName() |
long |
getPendingExchangeCount() |
Set<DisruptorProducer> |
getProducers()
Returns the current active producers on this endpoint
|
DisruptorProducerType |
getProducerType() |
long |
getRemainingCapacity() |
int |
getSize() |
long |
getTimeout() |
org.apache.camel.WaitForTaskToComplete |
getWaitForTaskToComplete() |
DisruptorWaitStrategy |
getWaitStrategy() |
int |
hashCode() |
boolean |
isBlockWhenFull() |
boolean |
isMultipleConsumers()
Specifies whether multiple consumers are allowed.
|
boolean |
isMultipleConsumersSupported() |
boolean |
isSingleton() |
void |
setBlockWhenFull(boolean blockWhenFull)
Whether a thread that sends messages to a full Disruptor will block until the ringbuffer's capacity is no longer exhausted.
|
void |
setProducerType(DisruptorProducerType producerType)
Defines the producers allowed on the Disruptor.
|
void |
setSize(int size)
The maximum capacity of the Disruptors ringbuffer
Will be effectively increased to the nearest power of two.
|
void |
setTimeout(long timeout)
Timeout (in milliseconds) before a 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 |
setWaitStrategy(DisruptorWaitStrategy waitStrategy)
Defines the strategy used by consumer threads to wait on new exchanges to be published.
|
configureConsumer, configurePollingConsumer, configureProperties, createEndpointConfiguration, createEndpointUri, createExchange, createExchange, createExchange, createPollingConsumer, getCamelContext, getConsumerProperties, getEndpointConfiguration, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, isBridgeErrorHandler, isLenientProperties, isPollingConsumerBlockWhenFull, isSynchronous, setBridgeErrorHandler, setCamelContext, setConsumerProperties, setEndpointConfiguration, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerQueueSize, setProperties, setSynchronous, toString
doResume, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
public static final String DISRUPTOR_IGNORE_EXCHANGE
public DisruptorEndpoint(String endpointUri, org.apache.camel.Component component, DisruptorReference disruptorReference, int concurrentConsumers, boolean multipleConsumers, boolean blockWhenFull) throws Exception
Exception
@ManagedAttribute(description="Queue name") public String getName()
@ManagedAttribute(description="Buffer max capacity") public int getBufferSize()
@ManagedAttribute(description="Remaining capacity in ring buffer") public long getRemainingCapacity() throws DisruptorNotStartedException
DisruptorNotStartedException
@ManagedAttribute(description="Amount of pending exchanges waiting for consumption in ring buffer") public long getPendingExchangeCount() throws DisruptorNotStartedException
DisruptorNotStartedException
@ManagedAttribute(description="Number of concurrent consumers") public int getConcurrentConsumers()
@ManagedAttribute(description="Option to specify whether the caller should wait for the async task to complete or not before continuing") public org.apache.camel.WaitForTaskToComplete getWaitForTaskToComplete()
public void setWaitForTaskToComplete(org.apache.camel.WaitForTaskToComplete waitForTaskToComplete)
@ManagedAttribute(description="Timeout (in milliseconds) before a producer will stop waiting for an asynchronous task to complete") public long getTimeout()
public void setTimeout(long timeout)
@ManagedAttribute(description="The maximum capacity of the Disruptors ringbuffer") public int getSize()
public void setSize(int size)
@ManagedAttribute(description="Specifies whether multiple consumers are allowed") public boolean isMultipleConsumersSupported()
isMultipleConsumersSupported
in interface org.apache.camel.MultipleConsumersSupport
public boolean isMultipleConsumers()
public Set<DisruptorConsumer> getConsumers()
public Set<DisruptorProducer> getProducers()
@ManagedAttribute public boolean isBlockWhenFull()
public void setBlockWhenFull(boolean blockWhenFull)
@ManagedAttribute(description="Defines the strategy used by consumer threads to wait on new exchanges to be published") public DisruptorWaitStrategy getWaitStrategy()
public void setWaitStrategy(DisruptorWaitStrategy waitStrategy)
@ManagedAttribute(description=" Defines the producers allowed on the Disruptor") public DisruptorProducerType getProducerType()
public void setProducerType(DisruptorProducerType producerType)
public boolean isSingleton()
isSingleton
in interface org.apache.camel.IsSingleton
public org.apache.camel.Producer createProducer() throws Exception
createProducer
in interface org.apache.camel.Endpoint
Exception
public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor) throws Exception
createConsumer
in interface org.apache.camel.Endpoint
Exception
protected void doStart() throws Exception
doStart
in class org.apache.camel.impl.DefaultEndpoint
Exception
protected void doStop() throws Exception
doStop
in class org.apache.camel.impl.DefaultEndpoint
Exception
protected void doShutdown() throws Exception
doShutdown
in class org.apache.camel.support.ServiceSupport
Exception
public DisruptorComponent getComponent()
getComponent
in class org.apache.camel.impl.DefaultEndpoint
public boolean equals(Object object)
equals
in class org.apache.camel.impl.DefaultEndpoint
public int hashCode()
hashCode
in class org.apache.camel.impl.DefaultEndpoint
Apache Camel