Interface RoutePolicyFactory
public interface RoutePolicyFactory
Factory that creates a
RoutePolicy instance for each route automatically at startup, without requiring the
policy to be declared per-route in the DSL.
Factories are registered globally via CamelContext.addRoutePolicyFactory(RoutePolicyFactory)
and are called once per route during CamelContext startup. Returning null from
createRoutePolicy(org.apache.camel.CamelContext, String, org.apache.camel.NamedNode) opts that specific
route out of the policy. This is useful for cross-cutting concerns such as universal throttling, auditing, or metrics
collection that should apply to all routes.
See the Route Policy documentation for examples.- See Also:
-
Method Summary
Modifier and TypeMethodDescription@Nullable RoutePolicycreateRoutePolicy(CamelContext camelContext, String routeId, NamedNode route) Creates a newRoutePolicywhich will be assigned to the given route.
-
Method Details
-
createRoutePolicy
Creates a newRoutePolicywhich will be assigned to the given route.- Parameters:
camelContext- the camel contextrouteId- the route idroute- the route definition- Returns:
- the created
RoutePolicy, or null to not use a policy for this route
-