Skip to main content

PersistenceStore

Trait PersistenceStore 

Source
pub trait PersistenceStore: Send + Sync {
    // Required methods
    fn append<'life0, 'async_trait>(
        &'life0 self,
        envelope: PersistenceEnvelope,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn load<'life0, 'life1, 'async_trait>(
        &'life0 self,
        trace_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<PersistedTrace>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn resume<'life0, 'life1, 'async_trait>(
        &'life0 self,
        trace_id: &'life1 str,
        resume_from_step: u64,
    ) -> Pin<Box<dyn Future<Output = Result<ResumeCursor>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn complete<'life0, 'life1, 'async_trait>(
        &'life0 self,
        trace_id: &'life1 str,
        completion: CompletionState,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn save_intervention<'life0, 'life1, 'async_trait>(
        &'life0 self,
        trace_id: &'life1 str,
        intervention: Intervention,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Persistence abstraction for long-running workflow crash recovery.

Production-stable since 0.12 (M156).

Implement this trait to store and reload Axon execution checkpoints across process restarts. The runtime calls append on each step and complete on terminal outcomes. Use resume to replay a pipeline from a saved cursor.

§Built-in adapters

AdapterFeature flagBest for
InMemoryPersistenceStorenone (default)tests, local dev
[PostgresPersistenceStore]persistence-postgresdurable prod storage
[RedisPersistenceStore]persistence-redisephemeral/fast checkpoints

§See also

  • docs/03_guides/persistence_ops_runbook.md — operational playbook
  • docs/manual/04_PERSISTENCE.md — concept guide + adapter selection

Required Methods§

Source

fn append<'life0, 'async_trait>( &'life0 self, envelope: PersistenceEnvelope, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn load<'life0, 'life1, 'async_trait>( &'life0 self, trace_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<PersistedTrace>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn resume<'life0, 'life1, 'async_trait>( &'life0 self, trace_id: &'life1 str, resume_from_step: u64, ) -> Pin<Box<dyn Future<Output = Result<ResumeCursor>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn complete<'life0, 'life1, 'async_trait>( &'life0 self, trace_id: &'life1 str, completion: CompletionState, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn save_intervention<'life0, 'life1, 'async_trait>( &'life0 self, trace_id: &'life1 str, intervention: Intervention, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§