Package org.apache.camel.impl.engine
Class DurationRoutePolicyFactory
java.lang.Object
org.apache.camel.impl.engine.DurationRoutePolicyFactory
- All Implemented Interfaces:
org.apache.camel.spi.RoutePolicyFactory
@Metadata(label="bean",
description="RoutePolicyFactory which executes for a duration and then triggers an action. This can be used to stop a set of routes after they have processed a number of messages, or has been running for N seconds.",
annotations="interfaceName=org.apache.camel.spi.RoutePolicyFactory")
@Configurer(metadataOnly=true)
public class DurationRoutePolicyFactory
extends Object
implements org.apache.camel.spi.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 they have processed a number of messages, or has
been running for N seconds.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.camel.spi.RoutePolicycreateRoutePolicy(org.apache.camel.CamelContext camelContext, String routeId, org.apache.camel.NamedNode route) intintvoidsetAction(DurationRoutePolicy.Action action) What action to perform when maximum is triggered.voidsetFromRouteId(String fromRouteId) Limit the route policy to the route which matches this patternvoidsetMaxMessages(int maxMessages) Maximum number of messages to process before the action is triggeredvoidsetMaxSeconds(int maxSeconds) Maximum seconds Camel is running before the action is triggered
-
Constructor Details
-
DurationRoutePolicyFactory
public DurationRoutePolicyFactory()
-
-
Method Details
-
createRoutePolicy
public org.apache.camel.spi.RoutePolicy createRoutePolicy(org.apache.camel.CamelContext camelContext, String routeId, org.apache.camel.NamedNode route) - Specified by:
createRoutePolicyin interfaceorg.apache.camel.spi.RoutePolicyFactory
-
getFromRouteId
-
setFromRouteId
Limit the route policy to the route which matches this pattern- See Also:
-
getMaxMessages
public int getMaxMessages() -
setMaxMessages
public void setMaxMessages(int maxMessages) Maximum number of messages to process before the action is triggered -
getMaxSeconds
public int getMaxSeconds() -
setMaxSeconds
public void setMaxSeconds(int maxSeconds) Maximum seconds Camel is running before the action is triggered -
getAction
-
setAction
What action to perform when maximum is triggered.
-