Search Results for

    Show / Hide Table of Contents

    Class JournalRecoveryBehavior

    Built-in Journal interceptors who will alter messages Recovery and/or Write of TestJournal.

    Inheritance
    object
    JournalRecoveryBehavior
    JournalWriteBehavior
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Akka.Persistence.TestKit
    Assembly: Akka.Persistence.TestKit.dll
    Syntax
    public class JournalRecoveryBehavior

    Methods

    | Edit this page View Source

    Fail()

    Always fail all messages.

    Declaration
    public Task Fail()
    Returns
    Type Description
    Task
    Remarks

    Journal will crash and UntypedPersistentActor.OnPersistFailure will be called on persistent actor.

    Use this Journal behavior when it is needed to verify how well a persistent actor will handle network problems and similar issues with underlying journal.

    | Edit this page View Source

    FailIf(Func<IPersistentRepresentation, bool>)

    Fail message if predicate predicate will return true.

    Declaration
    public Task FailIf(Func<IPersistentRepresentation, bool> predicate)
    Parameters
    Type Name Description
    Func<IPersistentRepresentation, bool> predicate
    Returns
    Type Description
    Task
    Remarks

    Journal will crash and UntypedPersistentActor.OnPersistFailure will be called on persistent actor.

    Use this Journal behavior when it is needed to verify how well a persistent actor will handle network problems and similar issues with underlying journal.

    Exceptions
    Type Condition
    ArgumentNullException

    When predicate is null.

    | Edit this page View Source

    FailIf(Func<IPersistentRepresentation, Task<bool>>)

    Fail message if async predicate predicate will return true.

    Declaration
    public Task FailIf(Func<IPersistentRepresentation, Task<bool>> predicate)
    Parameters
    Type Name Description
    Func<IPersistentRepresentation, Task<bool>> predicate
    Returns
    Type Description
    Task
    Remarks

    Journal will crash and UntypedPersistentActor.OnPersistFailure will be called on persistent actor.

    Use this Journal behavior when it is needed to verify how well a persistent actor will handle network problems and similar issues with underlying journal.

    Exceptions
    Type Condition
    ArgumentNullException

    When predicate is null.

    | Edit this page View Source

    FailIfWithDelay(TimeSpan, Func<IPersistentRepresentation, bool>)

    Fail message after specified delay if predicate predicate will return true.

    Declaration
    public Task FailIfWithDelay(TimeSpan delay, Func<IPersistentRepresentation, bool> predicate)
    Parameters
    Type Name Description
    TimeSpan delay
    Func<IPersistentRepresentation, bool> predicate
    Returns
    Type Description
    Task
    Remarks

    Each message will be delayed individually.

    Journal will crash and UntypedPersistentActor.OnPersistFailure will be called on persistent actor.

    Use this Journal behavior when it is needed to verify how well a persistent actor will handle network problems and similar issues with underlying journal.

    Exceptions
    Type Condition
    ArgumentException

    When delay is less or equal to Zero.

    ArgumentNullException

    When predicate is null.

    | Edit this page View Source

    FailIfWithDelay(TimeSpan, Func<IPersistentRepresentation, Task<bool>>)

    Fail message after specified delay if async predicate predicate will return true.

    Declaration
    public Task FailIfWithDelay(TimeSpan delay, Func<IPersistentRepresentation, Task<bool>> predicate)
    Parameters
    Type Name Description
    TimeSpan delay
    Func<IPersistentRepresentation, Task<bool>> predicate
    Returns
    Type Description
    Task
    Remarks

    Each message will be delayed individually.

    Journal will crash and UntypedPersistentActor.OnPersistFailure will be called on persistent actor.

    Use this Journal behavior when it is needed to verify how well a persistent actor will handle network problems and similar issues with underlying journal.

    Exceptions
    Type Condition
    ArgumentException

    When delay is less or equal to Zero.

    ArgumentNullException

    When predicate is null.

    | Edit this page View Source

    FailOnType(Type)

    Fail message during processing message of type messageType.

    Declaration
    public Task FailOnType(Type messageType)
    Parameters
    Type Name Description
    Type messageType
    Returns
    Type Description
    Task
    Remarks

    Journal will crash and UntypedPersistentActor.OnPersistFailure will be called on persistent actor.

    Use this Journal behavior when it is needed to verify how well a persistent actor will handle network problems and similar issues with underlying journal.

    • If messageType is interface, journal will fail when message implements that interface.
    • If messageType is class, journal will fail when message can be assigned to messageType.
    Exceptions
    Type Condition
    ArgumentNullException

    When messageType is null.

    | Edit this page View Source

    FailOnTypeWithDelay(TimeSpan, Type)

    Fail message after specified delay if recovering message of type messageType.

    Declaration
    public Task FailOnTypeWithDelay(TimeSpan delay, Type messageType)
    Parameters
    Type Name Description
    TimeSpan delay
    Type messageType
    Returns
    Type Description
    Task
    Remarks

    Each message will be delayed individually.

    Journal will crash and UntypedPersistentActor.OnPersistFailure will be called on persistent actor.

    Use this Journal behavior when it is needed to verify how well a persistent actor will handle network problems and similar issues with underlying journal.

    • If messageType is interface, journal will fail when message implements that interface.
    • If messageType is class, journal will fail when message can be assigned to messageType.
    Exceptions
    Type Condition
    ArgumentException

    When delay is less or equal to Zero.

    ArgumentNullException

    When messageType is null.

    | Edit this page View Source

    FailOnTypeWithDelay<TMessage>(TimeSpan)

    Fail message after specified delay if recovering message of type TMessage.

    Declaration
    public Task FailOnTypeWithDelay<TMessage>(TimeSpan delay)
    Parameters
    Type Name Description
    TimeSpan delay
    Returns
    Type Description
    Task
    Type Parameters
    Name Description
    TMessage
    Remarks

    Each message will be delayed individually.

    Journal will crash and UntypedPersistentActor.OnPersistFailure will be called on persistent actor.

    Use this Journal behavior when it is needed to verify how well a persistent actor will handle network problems and similar issues with underlying journal.

    • If TMessage is interface, journal will fail when message implements that interface.
    • If TMessage is class, journal will fail when message can be assigned to TMessage.
    Exceptions
    Type Condition
    ArgumentException

    When delay is less or equal to Zero.

    | Edit this page View Source

    FailOnType<TMessage>()

    Fail message during processing message of type TMessage.

    Declaration
    public Task FailOnType<TMessage>()
    Returns
    Type Description
    Task
    Type Parameters
    Name Description
    TMessage
    Remarks

    Journal will crash and UntypedPersistentActor.OnPersistFailure will be called on persistent actor.

    Use this Journal behavior when it is needed to verify how well a persistent actor will handle network problems and similar issues with underlying journal.

    • If TMessage is interface, journal will fail when message implements that interface.
    • If TMessage is class, journal will fail when message can be assigned to TMessage.
    | Edit this page View Source

    FailUnless(Func<IPersistentRepresentation, bool>)

    Fail message unless predicate predicate will return true.

    Declaration
    public Task FailUnless(Func<IPersistentRepresentation, bool> predicate)
    Parameters
    Type Name Description
    Func<IPersistentRepresentation, bool> predicate
    Returns
    Type Description
    Task
    Remarks

    Journal will crash and UntypedPersistentActor.OnPersistFailure will be called on persistent actor.

    Use this Journal behavior when it is needed to verify how well a persistent actor will handle network problems and similar issues with underlying journal.

    Exceptions
    Type Condition
    ArgumentNullException

    When predicate is null.

    | Edit this page View Source

    FailUnless(Func<IPersistentRepresentation, Task<bool>>)

    Fail message unless async predicate predicate will return true.

    Declaration
    public Task FailUnless(Func<IPersistentRepresentation, Task<bool>> predicate)
    Parameters
    Type Name Description
    Func<IPersistentRepresentation, Task<bool>> predicate
    Returns
    Type Description
    Task
    Remarks

    Journal will crash and UntypedPersistentActor.OnPersistFailure will be called on persistent actor.

    Use this Journal behavior when it is needed to verify how well a persistent actor will handle network problems and similar issues with underlying journal.

    Exceptions
    Type Condition
    ArgumentNullException

    When predicate is null.

    | Edit this page View Source

    FailUnlessWithDelay(TimeSpan, Func<IPersistentRepresentation, bool>)

    Fail message after specified delay unless predicate predicate will return true.

    Declaration
    public Task FailUnlessWithDelay(TimeSpan delay, Func<IPersistentRepresentation, bool> predicate)
    Parameters
    Type Name Description
    TimeSpan delay
    Func<IPersistentRepresentation, bool> predicate
    Returns
    Type Description
    Task
    Remarks

    Each message will be delayed individually.

    Journal will crash and UntypedPersistentActor.OnPersistFailure will be called on persistent actor.

    Use this Journal behavior when it is needed to verify how well a persistent actor will handle network problems and similar issues with underlying journal.

    Exceptions
    Type Condition
    ArgumentException

    When delay is less or equal to Zero.

    ArgumentNullException

    When predicate is null.

    | Edit this page View Source

    FailUnlessWithDelay(TimeSpan, Func<IPersistentRepresentation, Task<bool>>)

    Fail message after specified delay unless async predicate predicate will return true.

    Declaration
    public Task FailUnlessWithDelay(TimeSpan delay, Func<IPersistentRepresentation, Task<bool>> predicate)
    Parameters
    Type Name Description
    TimeSpan delay
    Func<IPersistentRepresentation, Task<bool>> predicate
    Returns
    Type Description
    Task
    Remarks

    Each message will be delayed individually.

    Journal will crash and UntypedPersistentActor.OnPersistFailure will be called on persistent actor.

    Use this Journal behavior when it is needed to verify how well a persistent actor will handle network problems and similar issues with underlying journal.

    Exceptions
    Type Condition
    ArgumentException

    When delay is less or equal to Zero.

    ArgumentNullException

    When predicate is null.

    | Edit this page View Source

    FailWithDelay(TimeSpan)

    Fail message after specified delay.

    Declaration
    public Task FailWithDelay(TimeSpan delay)
    Parameters
    Type Name Description
    TimeSpan delay
    Returns
    Type Description
    Task
    Remarks

    Each message will be delayed individually.

    Journal will crash and UntypedPersistentActor.OnPersistFailure will be called on persistent actor.

    Use this Journal behavior when it is needed to verify how well a persistent actor will handle network problems and similar issues with underlying journal.

    Exceptions
    Type Condition
    ArgumentException

    When delay is less or equal to Zero.

    | Edit this page View Source

    Pass()

    Pass all messages to journal without interfering.

    Declaration
    public Task Pass()
    Returns
    Type Description
    Task
    Remarks

    By using this interceptor TestJournal all journal operations will work like in standard MemoryJournal.

    | Edit this page View Source

    PassWithDelay(TimeSpan)

    Delay passing all messages to journal by delay.

    Declaration
    public Task PassWithDelay(TimeSpan delay)
    Parameters
    Type Name Description
    TimeSpan delay

    Time by which recovery operation will be delayed.

    Returns
    Type Description
    Task
    Remarks

    Each message will be delayed individually.

    Exceptions
    Type Condition
    ArgumentException

    When delay is less or equal to Zero.

    | Edit this page View Source

    SetInterceptorAsync(IJournalInterceptor)

    Use custom, user defined interceptor.

    Declaration
    public Task SetInterceptorAsync(IJournalInterceptor interceptor)
    Parameters
    Type Name Description
    IJournalInterceptor interceptor

    User defined interceptor which implements IJournalInterceptor interface.

    Returns
    Type Description
    Task
    Exceptions
    Type Condition
    ArgumentNullException

    When interceptor is null.

    Extension Methods

    ObjectExtensions.IsDefaultForType<T>(T)
    ObjectExtensions.AsOption<T>(T)
    Extensions.AsInstanceOf<T>(object)
    In this article
    • githubEdit this page
    • View Source
    Back to top
    Contribute
    • Project Chat
    • Discussion Forum
    • Source Code
    Support
    • Akka.NET Support Plans
    • Akka.NET Observability Tools
    • Akka.NET Training & Consulting
    Maintained By
    • Petabridge - The Akka.NET Company
    • Learn Akka.NET