pub struct SupervisingRouteController { /* private fields */ }Expand description
A route controller that automatically restarts crashed routes.
Wraps a DefaultRouteController and spawns a supervision loop that
receives crash notifications and restarts routes with exponential backoff.
Implementations§
Source§impl SupervisingRouteController
impl SupervisingRouteController
Sourcepub fn new(registry: Arc<Mutex<Registry>>, config: SupervisionConfig) -> Self
pub fn new(registry: Arc<Mutex<Registry>>, config: SupervisionConfig) -> Self
Create a new supervising controller.
Sourcepub fn with_languages(
registry: Arc<Mutex<Registry>>,
config: SupervisionConfig,
languages: SharedLanguageRegistry,
) -> Self
pub fn with_languages( registry: Arc<Mutex<Registry>>, config: SupervisionConfig, languages: SharedLanguageRegistry, ) -> Self
Create a new supervising controller with shared language registry.
Sourcepub fn with_metrics(self, metrics: Arc<dyn MetricsCollector>) -> Self
pub fn with_metrics(self, metrics: Arc<dyn MetricsCollector>) -> Self
Set a metrics collector for the supervision loop.
Trait Implementations§
Source§impl RouteController for SupervisingRouteController
impl RouteController for SupervisingRouteController
Source§fn start_route<'life0, 'life1, 'async_trait>(
&'life0 mut self,
route_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), CamelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn start_route<'life0, 'life1, 'async_trait>(
&'life0 mut self,
route_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), CamelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Start a specific route by its ID. Read more
Source§fn stop_route<'life0, 'life1, 'async_trait>(
&'life0 mut self,
route_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), CamelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn stop_route<'life0, 'life1, 'async_trait>(
&'life0 mut self,
route_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), CamelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Stop a specific route by its ID. Read more
Source§fn restart_route<'life0, 'life1, 'async_trait>(
&'life0 mut self,
route_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), CamelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn restart_route<'life0, 'life1, 'async_trait>(
&'life0 mut self,
route_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), CamelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Restart a specific route by its ID. Read more
Source§fn suspend_route<'life0, 'life1, 'async_trait>(
&'life0 mut self,
route_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), CamelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn suspend_route<'life0, 'life1, 'async_trait>(
&'life0 mut self,
route_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), CamelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Suspend a specific route by its ID. Read more
Source§fn resume_route<'life0, 'life1, 'async_trait>(
&'life0 mut self,
route_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), CamelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn resume_route<'life0, 'life1, 'async_trait>(
&'life0 mut self,
route_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), CamelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Resume a suspended route by its ID. Read more
Source§impl RouteControllerInternal for SupervisingRouteController
impl RouteControllerInternal for SupervisingRouteController
Source§fn add_route(&mut self, def: RouteDefinition) -> Result<(), CamelError>
fn add_route(&mut self, def: RouteDefinition) -> Result<(), CamelError>
Add a route definition to the controller.
Source§fn swap_pipeline(
&self,
route_id: &str,
pipeline: BoxProcessor,
) -> Result<(), CamelError>
fn swap_pipeline( &self, route_id: &str, pipeline: BoxProcessor, ) -> Result<(), CamelError>
Atomically swap the pipeline of a running route (for hot-reload).
Source§fn route_from_uri(&self, route_id: &str) -> Option<String>
fn route_from_uri(&self, route_id: &str) -> Option<String>
Returns the
from_uri of a route by ID.Source§fn set_error_handler(&mut self, config: ErrorHandlerConfig)
fn set_error_handler(&mut self, config: ErrorHandlerConfig)
Set a global error handler applied to all routes.
Source§fn set_self_ref(&mut self, self_ref: Arc<Mutex<dyn RouteController>>)
fn set_self_ref(&mut self, self_ref: Arc<Mutex<dyn RouteController>>)
Set the self-reference needed to create
ProducerContext.Source§fn set_runtime_handle(&mut self, runtime: Arc<dyn RuntimeHandle>)
fn set_runtime_handle(&mut self, runtime: Arc<dyn RuntimeHandle>)
Set runtime handle for ProducerContext command/query access.
Source§fn route_count(&self) -> usize
fn route_count(&self) -> usize
Returns the number of routes in the controller.
Source§fn auto_startup_route_ids(&self) -> Vec<String>
fn auto_startup_route_ids(&self) -> Vec<String>
Returns route IDs that should auto-start, sorted by startup order (ascending).
Source§fn shutdown_route_ids(&self) -> Vec<String>
fn shutdown_route_ids(&self) -> Vec<String>
Returns route IDs sorted by shutdown order (startup order descending).
Source§fn set_tracer_config(&mut self, config: &TracerConfig)
fn set_tracer_config(&mut self, config: &TracerConfig)
Configure tracing from a
TracerConfig.Source§fn compile_route_definition(
&self,
def: RouteDefinition,
) -> Result<BoxProcessor, CamelError>
fn compile_route_definition( &self, def: RouteDefinition, ) -> Result<BoxProcessor, CamelError>
Compile a
RouteDefinition into a BoxProcessor without inserting it into the route map.
Used by hot-reload to prepare a new pipeline for atomic swap.Source§fn remove_route(&mut self, route_id: &str) -> Result<(), CamelError>
fn remove_route(&mut self, route_id: &str) -> Result<(), CamelError>
Remove a route from the controller map (route must be stopped first).
Source§fn start_route_reload<'life0, 'life1, 'async_trait>(
&'life0 mut self,
route_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), CamelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn start_route_reload<'life0, 'life1, 'async_trait>(
&'life0 mut self,
route_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), CamelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Start a route by ID (for use by hot-reload, where async_trait is required).
Source§fn stop_route_reload<'life0, 'life1, 'async_trait>(
&'life0 mut self,
route_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), CamelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn stop_route_reload<'life0, 'life1, 'async_trait>(
&'life0 mut self,
route_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), CamelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Stop a route by ID (for use by hot-reload, where async_trait is required).
Auto Trait Implementations§
impl Freeze for SupervisingRouteController
impl !RefUnwindSafe for SupervisingRouteController
impl Send for SupervisingRouteController
impl Sync for SupervisingRouteController
impl Unpin for SupervisingRouteController
impl UnsafeUnpin for SupervisingRouteController
impl !UnwindSafe for SupervisingRouteController
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more