public class DurationRoutePolicyFactory extends Object implements RoutePolicyFactory
RoutePolicyFactory
which executes for a duration and then triggers an action.
This can be used to stop a set of routes (or CamelContext) after it has processed a number of messages, or has been running for N seconds.Constructor and Description |
---|
DurationRoutePolicyFactory() |
Modifier and Type | Method and Description |
---|---|
RoutePolicy |
createRoutePolicy(CamelContext camelContext,
String routeId,
RouteDefinition route)
Creates a new
RoutePolicy which will be assigned to the given route. |
org.apache.camel.impl.DurationRoutePolicy.Action |
getAction() |
String |
getFromRouteId() |
int |
getMaxSeconds() |
void |
setAction(org.apache.camel.impl.DurationRoutePolicy.Action action)
What action to perform when maximum is triggered.
|
void |
setFromRouteId(String fromRouteId)
Limit the route policy to the route which matches this pattern
|
void |
setMaxMessages(int maxMessages)
Maximum number of messages to process before the action is triggered
|
void |
setMaxSeconds(int maxSeconds)
Maximum seconds Camel is running before the action is triggered
|
public DurationRoutePolicyFactory()
public RoutePolicy createRoutePolicy(CamelContext camelContext, String routeId, RouteDefinition route)
RoutePolicyFactory
RoutePolicy
which will be assigned to the given route.createRoutePolicy
in interface RoutePolicyFactory
camelContext
- the camel contextrouteId
- the route idroute
- the route definitionRoutePolicy
, or null to not use a policy for this routepublic String getFromRouteId()
public void setFromRouteId(String fromRouteId)
public void setMaxMessages(int maxMessages)
public int getMaxSeconds()
public void setMaxSeconds(int maxSeconds)
public org.apache.camel.impl.DurationRoutePolicy.Action getAction()
public void setAction(org.apache.camel.impl.DurationRoutePolicy.Action action)
Apache Camel