[
https://issues.apache.org/jira/browse/CAMEL-6840?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16506938#comment-16506938
]
ASF GitHub Bot commented on CAMEL-6840:
---------------------------------------
davsclaus commented on a change in pull request #2366: CAMEL-6840 make it
possible grouped throttling
URL: https://github.com/apache/camel/pull/2366#discussion_r194224758
##########
File path:
camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java
##########
@@ -2284,6 +2284,48 @@ public ThrottleDefinition throttle(Expression
maximumRequestCount) {
addOutput(answer);
return answer;
}
+
+ /**
+ * <a href="http://camel.apache.org/throttler.html">Throttler EIP:</a>
+ * Creates a throttler allowing you to ensure that a specific endpoint
does not get overloaded,
+ * or that we don't exceed an agreed SLA with some external service.
+ * Here another parameter correlationExpressionKey is introduced for the
functionality which
+ * will throttle based on the key expression to group exchanges. This will
make key-based throttling
+ * instead of overall throttling.
+ * <p/>
+ * Will default use a time period of 1 second, so setting the
maximumRequestCount to eg 10
+ * will default ensure at most 10 messages per second.
+ *
+ * @param maximumRequestCount an expression to calculate the maximum
request count
+ * @param correlationExpressionKey is a correlation key that can throttle
by the given key instead of overall throttling
+ * @return the builder
+ */
+ public ThrottleDefinition throttle(long correlationExpressionKey,
Expression maximumRequestCount) {
+ ThrottleDefinition answer = new
ThrottleDefinition(ExpressionBuilder.constantExpression(correlationExpressionKey),
maximumRequestCount);
+ addOutput(answer);
+ return answer;
+ }
+
+ /**
+ * <a href="http://camel.apache.org/throttler.html">Throttler EIP:</a>
+ * Creates a throttler allowing you to ensure that a specific endpoint
does not get overloaded,
+ * or that we don't exceed an agreed SLA with some external service.
+ * Here another parameter correlationExpressionKey is introduced for the
functionality which
+ * will throttle based on the key expression to group exchanges. This will
make key-based throttling
+ * instead of overall throttling.
+ * <p/>
+ * Will default use a time period of 1 second, so setting the
maximumRequestCount to eg 10
+ * will default ensure at most 10 messages per second.
+ *
+ * @param maximumRequestCount an expression to calculate the maximum
request count
+ * @param correlationExpressionKey is a correlation key as an expression
that can throttle by the given key instead of overall throttling
Review comment:
The javadoc param should be in the same order as in the method signature
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Allow Throttler EIP to specify SLA per client/correlated-group
> --------------------------------------------------------------
>
> Key: CAMEL-6840
> URL: https://issues.apache.org/jira/browse/CAMEL-6840
> Project: Camel
> Issue Type: New Feature
> Components: camel-core, eip
> Reporter: Christian Posta
> Priority: Major
> Fix For: Future
>
>
> Basic idea is to allow throttler to have a predicate to determine whether or
> not to apply throttling to that exchange.
> From this Mailing List discussion:
> http://camel.465427.n5.nabble.com/Throttling-by-client-ID-td5741032.html
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)