|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.camel.impl.ServiceSupport
org.apache.camel.impl.RoutePolicySupport
org.apache.camel.impl.ThrottlingInflightRoutePolicy
public class ThrottlingInflightRoutePolicy
A throttle based RoutePolicy
which is capable of dynamic
throttling a route based on number of current inflight exchanges.
Nested Class Summary | |
---|---|
static class |
ThrottlingInflightRoutePolicy.ThrottlingScope
|
Field Summary |
---|
Fields inherited from class org.apache.camel.impl.RoutePolicySupport |
---|
log |
Constructor Summary | |
---|---|
ThrottlingInflightRoutePolicy()
|
Method Summary | |
---|---|
protected CamelLogger |
createLogger()
|
CamelLogger |
getLogger()
|
LoggingLevel |
getLoggingLevel()
|
int |
getMaxInflightExchanges()
|
int |
getResumePercentOfMax()
|
ThrottlingInflightRoutePolicy.ThrottlingScope |
getScope()
|
void |
onExchangeDone(Route route,
Exchange exchange)
Callback invoked when an Exchange is done being routed, where it started from the given Route
Notice this callback is invoked when the Exchange is done and the Route is the route where
the Exchange was started. |
void |
setLogger(CamelLogger logger)
Sets the logger to use for logging throttling activity. |
void |
setLoggingLevel(LoggingLevel loggingLevel)
Sets the logging level to report the throttling activity. |
void |
setMaxInflightExchanges(int maxInflightExchanges)
Sets the upper limit of number of concurrent inflight exchanges at which point reached the throttler should suspend the route. |
void |
setResumePercentOfMax(int resumePercentOfMax)
Sets at which percentage of the max the throttler should start resuming the route. |
void |
setScope(ThrottlingInflightRoutePolicy.ThrottlingScope scope)
Sets which scope the throttling should be based upon, either route or total scoped. |
String |
toString()
|
Methods inherited from class org.apache.camel.impl.RoutePolicySupport |
---|
doStart, doStop, getExceptionHandler, handleException, onExchangeBegin, onInit, setExceptionHandler, startConsumer, startRoute, stopConsumer, stopRoute, stopRoute |
Methods inherited from class org.apache.camel.impl.ServiceSupport |
---|
addChildService, doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspended, isSuspending, removeChildService, resume, shutdown, start, start, stop, suspend |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ThrottlingInflightRoutePolicy()
Method Detail |
---|
public String toString()
toString
in class Object
public void onExchangeDone(Route route, Exchange exchange)
RoutePolicy
Exchange
is done being routed, where it started from the given Route
Notice this callback is invoked when the Exchange is done and the Route
is the route where
the Exchange
was started. Most often its also the route where the exchange is done. However its
possible to route an Exchange
to other routes using endpoints such as
direct or seda. Bottom line is that the Route
parameter may not be the endpoint
route and thus why we state its the starting route.
onExchangeDone
in interface RoutePolicy
onExchangeDone
in class RoutePolicySupport
route
- the route where the exchange started fromexchange
- the created exchangepublic int getMaxInflightExchanges()
public void setMaxInflightExchanges(int maxInflightExchanges)
maxInflightExchanges
- the upper limit of concurrent inflight exchangespublic int getResumePercentOfMax()
public void setResumePercentOfMax(int resumePercentOfMax)
resumePercentOfMax
- the percentage must be between 0 and 100public ThrottlingInflightRoutePolicy.ThrottlingScope getScope()
public void setScope(ThrottlingInflightRoutePolicy.ThrottlingScope scope)
scope
- the scopepublic LoggingLevel getLoggingLevel()
public CamelLogger getLogger()
public void setLogger(CamelLogger logger)
logger
- the loggerpublic void setLoggingLevel(LoggingLevel loggingLevel)
loggingLevel
- the logging levelprotected CamelLogger createLogger()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |