@Metadata(label="eip,routing") public class ThrottleDefinition extends ExpressionNode implements ExecutorServiceAwareDefinition<ThrottleDefinition>
inheritErrorHandler, log
Constructor and Description |
---|
ThrottleDefinition() |
ThrottleDefinition(org.apache.camel.Expression maximumRequestsPerPeriod) |
ThrottleDefinition(org.apache.camel.Expression maximumRequestsPerPeriod,
org.apache.camel.Expression correlationExpression) |
Modifier and Type | Method and Description |
---|---|
ThrottleDefinition |
asyncDelayed()
Enables asynchronous delay which means the thread will not block while delaying.
|
ThrottleDefinition |
asyncDelayed(boolean asyncDelayed)
Enables asynchronous delay which means the thread will not block while delaying.
|
ThrottleDefinition |
asyncDelayed(String asyncDelayed)
Enables asynchronous delay which means the thread will not block while delaying.
|
ThrottleDefinition |
callerRunsWhenRejected(boolean callerRunsWhenRejected)
Whether or not the caller should run the task when it was rejected by the thread pool.
|
ThrottleDefinition |
callerRunsWhenRejected(String callerRunsWhenRejected)
Whether or not the caller should run the task when it was rejected by the thread pool.
|
ThrottleDefinition |
correlationExpression(org.apache.camel.Expression correlationExpression)
To use a correlation expression that can throttle by the given key instead of overall throttling
|
ThrottleDefinition |
correlationExpression(long correlationExpression)
To use a correlation expression that can throttle by the given key instead of overall throttling
|
protected String |
description() |
ThrottleDefinition |
executorService(ExecutorService executorService)
To use a custom thread pool (ScheduledExecutorService) by the throttler.
|
ThrottleDefinition |
executorServiceRef(String executorServiceRef)
To use a custom thread pool (ScheduledExecutorService) by the throttler.
|
String |
getAsyncDelayed() |
String |
getCallerRunsWhenRejected() |
ExpressionSubElementDefinition |
getCorrelationExpression() |
ExecutorService |
getExecutorService() |
String |
getExecutorServiceRef() |
String |
getLabel()
Returns a label to describe this node such as the expression if some kind of expression node
|
String |
getRejectExecution() |
String |
getShortName() |
String |
getTimePeriodMillis() |
ThrottleDefinition |
maximumRequestsPerPeriod(long maximumRequestsPerPeriod)
Sets the time period during which the maximum request count per period
|
ThrottleDefinition |
maximumRequestsPerPeriod(String maximumRequestsPerPeriod)
Sets the time period during which the maximum request count per period
|
ThrottleDefinition |
rejectExecution(boolean rejectExecution)
Whether or not throttler throws the ThrottlerRejectedExecutionException when the exchange exceeds the request
limit
Is by default false
|
ThrottleDefinition |
rejectExecution(String rejectExecution)
Whether or not throttler throws the ThrottlerRejectedExecutionException when the exchange exceeds the request
limit
Is by default false
|
void |
setAsyncDelayed(String asyncDelayed) |
void |
setCallerRunsWhenRejected(String callerRunsWhenRejected) |
void |
setCorrelationExpression(ExpressionSubElementDefinition correlationExpression)
The expression used to calculate the correlation key to use for throttle grouping.
|
void |
setExecutorService(ExecutorService executorService) |
void |
setExecutorServiceRef(String executorServiceRef) |
void |
setExpression(ExpressionDefinition expression)
Expression to configure the maximum number of messages to throttle per request
|
void |
setRejectExecution(String rejectExecution) |
void |
setTimePeriodMillis(String timePeriodMillis) |
ThrottleDefinition |
timePeriodMillis(long timePeriodMillis)
Sets the time period during which the maximum request count is valid for
|
ThrottleDefinition |
timePeriodMillis(String timePeriodMillis)
Sets the time period during which the maximum request count is valid for
|
String |
toString() |
configureChild, getExpression, getExpressionType, getOutputs, id, preCreateProcessor, setExpression, setExpressionType
addInterceptStrategy, addOutput, aggregate, aggregate, aggregate, aggregate, bean, bean, bean, bean, bean, bean, bean, bean, bean, bean, bean, choice, circuitBreaker, claimCheck, claimCheck, claimCheck, claimCheck, clearOutput, convertBodyTo, convertBodyTo, convertBodyTo, delay, delay, delay, doTry, dynamicRouter, dynamicRouter, end, endChoice, endCircuitBreaker, endDoTry, endParent, endRest, enrich, enrich, enrich, enrich, enrich, enrich, enrich, enrich, enrich, enrichWith, enrichWith, enrichWith, enrichWith, enrichWith, enrichWith, filter, filter, filter, filter, getIndex, getInterceptStrategies, getParent, idempotentConsumer, idempotentConsumer, idempotentConsumer, inheritErrorHandler, inOnly, inOnly, inOnly, inOnly, inOnly, inOut, inOut, inOut, inOut, inOut, isAbstract, isInheritErrorHandler, isTopLevelOnly, isWrappingEntireOutput, kamelet, loadBalance, loadBalance, log, log, log, log, log, log, loop, loop, loop, loopDoWhile, loopDoWhile, markRollbackOnly, markRollbackOnlyLast, marshal, marshal, marshal, marshal, multicast, multicast, multicast, onCompletion, onException, onException, pipeline, pipeline, pipeline, pipeline, policy, policy, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrichWith, pollEnrichWith, pollEnrichWith, pollEnrichWith, pollEnrichWith, pollEnrichWith, process, process, process, recipientList, recipientList, recipientList, recipientList, removeHeader, removeHeaders, removeHeaders, removeProperties, removeProperties, removeProperty, resequence, resequence, rollback, rollback, routeDescription, routeGroup, routeId, routingSlip, routingSlip, routingSlip, saga, sample, sample, sample, sample, script, script, serviceCall, serviceCall, serviceCall, setBody, setBody, setBody, setExchangePattern, setHeader, setHeader, setHeader, setInheritErrorHandler, setParent, setProperty, setProperty, setProperty, sort, sort, sort, split, split, split, split, startupOrder, step, step, stop, threads, threads, threads, threads, throttle, throttle, throttle, throttle, throttle, throwException, throwException, to, to, to, to, to, to, to, to, to, to, to, to, to, to, toD, toD, toD, toD, toD, toD, toD, toF, transacted, transacted, transform, transform, unmarshal, unmarshal, unmarshal, unmarshal, validate, validate, validate, wireTap, wireTap, wireTap
description, description, getCustomId, getDescription, getDescriptionText, getId, hasCustomIdAssigned, idOrCreate, setCustomId, setDescription, setGeneratedId, setId
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
executorService
public ThrottleDefinition()
public ThrottleDefinition(org.apache.camel.Expression maximumRequestsPerPeriod)
public ThrottleDefinition(org.apache.camel.Expression maximumRequestsPerPeriod, org.apache.camel.Expression correlationExpression)
protected String description()
public String getShortName()
getShortName
in interface org.apache.camel.NamedNode
public String getLabel()
ProcessorDefinition
getLabel
in interface org.apache.camel.NamedNode
getLabel
in class ExpressionNode
public ThrottleDefinition timePeriodMillis(long timePeriodMillis)
timePeriodMillis
- period in millispublic ThrottleDefinition timePeriodMillis(String timePeriodMillis)
timePeriodMillis
- period in millispublic ThrottleDefinition maximumRequestsPerPeriod(long maximumRequestsPerPeriod)
maximumRequestsPerPeriod
- the maximum request count number per time periodpublic ThrottleDefinition maximumRequestsPerPeriod(String maximumRequestsPerPeriod)
maximumRequestsPerPeriod
- the maximum request count number per time periodpublic ThrottleDefinition correlationExpression(long correlationExpression)
correlationExpression
- is a correlation key as a long number that can throttle by the given key instead of
overall throttlingpublic ThrottleDefinition correlationExpression(org.apache.camel.Expression correlationExpression)
correlationExpression
- is a correlation key as an expression that can throttle by the given key instead of
overall throttlingpublic ThrottleDefinition callerRunsWhenRejected(boolean callerRunsWhenRejected)
callerRunsWhenRejected
- whether or not the caller should runpublic ThrottleDefinition callerRunsWhenRejected(String callerRunsWhenRejected)
callerRunsWhenRejected
- whether or not the caller should runpublic ThrottleDefinition asyncDelayed()
public ThrottleDefinition asyncDelayed(boolean asyncDelayed)
public ThrottleDefinition asyncDelayed(String asyncDelayed)
public ThrottleDefinition rejectExecution(boolean rejectExecution)
rejectExecution
- throw the RejectExecutionException if the exchange exceeds the request limitpublic ThrottleDefinition rejectExecution(String rejectExecution)
rejectExecution
- throw the RejectExecutionException if the exchange exceeds the request limitpublic ThrottleDefinition executorService(ExecutorService executorService)
executorService
in interface ExecutorServiceAwareDefinition<ThrottleDefinition>
executorService
- the custom thread pool (must be scheduled)public ThrottleDefinition executorServiceRef(String executorServiceRef)
executorServiceRef
in interface ExecutorServiceAwareDefinition<ThrottleDefinition>
executorServiceRef
- the reference id of the thread pool (must be scheduled)public void setExpression(ExpressionDefinition expression)
setExpression
in class ExpressionNode
public String getTimePeriodMillis()
public void setTimePeriodMillis(String timePeriodMillis)
public String getAsyncDelayed()
public void setAsyncDelayed(String asyncDelayed)
public String getCallerRunsWhenRejected()
public void setCallerRunsWhenRejected(String callerRunsWhenRejected)
public ExecutorService getExecutorService()
getExecutorService
in interface org.apache.camel.ExecutorServiceAware
public void setExecutorService(ExecutorService executorService)
setExecutorService
in interface org.apache.camel.ExecutorServiceAware
public String getExecutorServiceRef()
getExecutorServiceRef
in interface org.apache.camel.ExecutorServiceAware
public void setExecutorServiceRef(String executorServiceRef)
setExecutorServiceRef
in interface org.apache.camel.ExecutorServiceAware
public String getRejectExecution()
public void setRejectExecution(String rejectExecution)
public void setCorrelationExpression(ExpressionSubElementDefinition correlationExpression)
public ExpressionSubElementDefinition getCorrelationExpression()
Apache Camel