Class JournalWriteBehavior
Built-in Journal interceptors who will alter message Write of TestJournal.
Inherited Members
Namespace: Akka.Persistence.TestKit
Assembly: Akka.Persistence.TestKit.dll
Syntax
public class JournalWriteBehavior : JournalRecoveryBehavior
Methods
| Improve this Doc View SourceReject()
Always reject all messages.
Declaration
public Task Reject()
Returns
Type | Description |
---|---|
Task |
Remarks
Journal will NOT crash, but UntypedPersistentActor.OnPersistRejected will be called on each rejected message.
Use this Journal behavior when it is needed to verify how well a persistent actor will handle serialization, type conversion and other local problems withing journal.
RejectIf(Func<IPersistentRepresentation, Boolean>)
Reject message if predicate predicate
will return true
.
Declaration
public Task RejectIf(Func<IPersistentRepresentation, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
Func<IPersistentRepresentation, Boolean> | predicate |
Returns
Type | Description |
---|---|
Task |
Remarks
Journal will NOT crash, but UntypedPersistentActor.OnPersistRejected will be called on each rejected message.
Use this Journal behavior when it is needed to verify how well a persistent actor will handle serialization, type conversion and other local problems withing journal.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | When |
RejectIf(Func<IPersistentRepresentation, Task<Boolean>>)
Reject message if async predicate predicate
will return true
.
Declaration
public Task RejectIf(Func<IPersistentRepresentation, Task<bool>> predicate)
Parameters
Type | Name | Description |
---|---|---|
Func<IPersistentRepresentation, Task<Boolean>> | predicate |
Returns
Type | Description |
---|---|
Task |
Remarks
Journal will NOT crash, but UntypedPersistentActor.OnPersistRejected will be called on each rejected message.
Use this Journal behavior when it is needed to verify how well a persistent actor will handle serialization, type conversion and other local problems withing journal.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | When |
RejectIfWithDelay(TimeSpan, Func<IPersistentRepresentation, Boolean>)
Reject message after specified delay if predicate predicate
will return true
.
Declaration
public Task RejectIfWithDelay(TimeSpan delay, Func<IPersistentRepresentation, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | delay | |
Func<IPersistentRepresentation, Boolean> | predicate |
Returns
Type | Description |
---|---|
Task |
Remarks
Each message will be delayed individually.
Journal will NOT crash, but UntypedPersistentActor.OnPersistRejected will be called on each rejected message.
Use this Journal behavior when it is needed to verify how well a persistent actor will handle serialization, type conversion and other local problems withing journal.
Exceptions
Type | Condition |
---|---|
ArgumentException | When |
ArgumentNullException | When |
RejectIfWithDelay(TimeSpan, Func<IPersistentRepresentation, Task<Boolean>>)
Reject message after specified delay if async predicate predicate
will return true
.
Declaration
public Task RejectIfWithDelay(TimeSpan delay, Func<IPersistentRepresentation, Task<bool>> predicate)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | delay | |
Func<IPersistentRepresentation, Task<Boolean>> | predicate |
Returns
Type | Description |
---|---|
Task |
Remarks
Each message will be delayed individually.
Journal will NOT crash, but UntypedPersistentActor.OnPersistRejected will be called on each rejected message.
Use this Journal behavior when it is needed to verify how well a persistent actor will handle serialization, type conversion and other local problems withing journal.
Exceptions
Type | Condition |
---|---|
ArgumentException | When |
ArgumentNullException | When |
RejectOnType(Type)
Reject message during processing message of type messageType
.
Declaration
public Task RejectOnType(Type messageType)
Parameters
Type | Name | Description |
---|---|---|
Type | messageType |
Returns
Type | Description |
---|---|
Task |
Remarks
Journal will NOT crash, but UntypedPersistentActor.OnPersistRejected> will be called on each rejected message.
Use this Journal behavior when it is needed to verify how well a persistent actor will handle serialization, type conversion and other local problems withing journal.
- If
messageType
is interface, journal will reject when message implements that interface. - If
messageType
is class, journal will reject when message can be assigned tomessageType
.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | When |
RejectOnType<TMessage>()
Reject message during processing message of type TMessage
.
Declaration
public Task RejectOnType<TMessage>()
Returns
Type | Description |
---|---|
Task |
Type Parameters
Name | Description |
---|---|
TMessage |
Remarks
Journal will NOT crash, but UntypedPersistentActor.OnPersistRejected will be called on each rejected message.
Use this Journal behavior when it is needed to verify how well a persistent actor will handle serialization, type conversion and other local problems withing journal.
- If
TMessage
is interface, journal will reject when message implements that interface. - If
TMessage
is class, journal will reject when message can be assigned toTMessage
.
RejectOnTypeWithDelay(TimeSpan, Type)
Reject message after specified delay if recovering message of type messageType
.
Declaration
public Task RejectOnTypeWithDelay(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 NOT crash, but UntypedPersistentActor.OnPersistRejected will be called on each rejected message.
Use this Journal behavior when it is needed to verify how well a persistent actor will handle serialization, type conversion and other local problems withing journal.
- If
messageType
is interface, journal will reject when message implements that interface. - If
messageType
is class, journal will reject when message can be assigned tomessageType
.
Exceptions
Type | Condition |
---|---|
ArgumentException | When |
ArgumentNullException | When |
RejectOnTypeWithDelay<TMessage>(TimeSpan)
Reject message after specified delay if recovering message of type TMessage
.
Declaration
public Task RejectOnTypeWithDelay<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 NOT crash, but UntypedPersistentActor.OnPersistRejected will be called on each rejected message.
Use this Journal behavior when it is needed to verify how well a persistent actor will handle serialization, type conversion and other local problems withing journal.
- If
TMessage
is interface, journal will reject when message implements that interface. - If
TMessage
is class, journal will reject when message can be assigned toTMessage
.
Exceptions
Type | Condition |
---|---|
ArgumentException | When |
RejectUnless(Func<IPersistentRepresentation, Boolean>)
Reject message unless predicate predicate
will return true
.
Declaration
public Task RejectUnless(Func<IPersistentRepresentation, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
Func<IPersistentRepresentation, Boolean> | predicate |
Returns
Type | Description |
---|---|
Task |
Remarks
Journal will NOT crash, but UntypedPersistentActor.OnPersistRejected will be called on each rejected message.
Use this Journal behavior when it is needed to verify how well a persistent actor will handle serialization, type conversion and other local problems withing journal.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | When |
RejectUnless(Func<IPersistentRepresentation, Task<Boolean>>)
Reject message unless async predicate predicate
will return true
.
Declaration
public Task RejectUnless(Func<IPersistentRepresentation, Task<bool>> predicate)
Parameters
Type | Name | Description |
---|---|---|
Func<IPersistentRepresentation, Task<Boolean>> | predicate |
Returns
Type | Description |
---|---|
Task |
Remarks
Journal will NOT crash, but UntypedPersistentActor.OnPersistRejected will be called on each rejected message.
Use this Journal behavior when it is needed to verify how well a persistent actor will handle serialization, type conversion and other local problems withing journal.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | When |
RejectUnlessWithDelay(TimeSpan, Func<IPersistentRepresentation, Boolean>)
Reject message after specified delay unless predicate predicate
will return true
.
Declaration
public Task RejectUnlessWithDelay(TimeSpan delay, Func<IPersistentRepresentation, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | delay | |
Func<IPersistentRepresentation, Boolean> | predicate |
Returns
Type | Description |
---|---|
Task |
Remarks
Each message will be delayed individually.
Journal will NOT crash, but UntypedPersistentActor.OnPersistRejected will be called on each rejected message.
Use this Journal behavior when it is needed to verify how well a persistent actor will handle serialization, type conversion and other local problems withing journal.
Exceptions
Type | Condition |
---|---|
ArgumentException | When |
ArgumentNullException | When |
RejectUnlessWithDelay(TimeSpan, Func<IPersistentRepresentation, Task<Boolean>>)
Reject message after specified delay unless async predicate predicate
will return true
.
Declaration
public Task RejectUnlessWithDelay(TimeSpan delay, Func<IPersistentRepresentation, Task<bool>> predicate)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | delay | |
Func<IPersistentRepresentation, Task<Boolean>> | predicate |
Returns
Type | Description |
---|---|
Task |
Remarks
Each message will be delayed individually.
Journal will NOT crash, but UntypedPersistentActor.OnPersistRejected will be called on each rejected message.
Use this Journal behavior when it is needed to verify how well a persistent actor will handle serialization, type conversion and other local problems withing journal.
Exceptions
Type | Condition |
---|---|
ArgumentException | When |
ArgumentNullException | When |
RejectWithDelay(TimeSpan)
Reject message after specified delay.
Declaration
public Task RejectWithDelay(TimeSpan delay)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | delay |
Returns
Type | Description |
---|---|
Task |
Remarks
Each message will be delayed individually.
Journal will NOT crash, but UntypedPersistentActor.OnPersistRejected will be called on each rejected message.
Use this Journal behavior when it is needed to verify how well a persistent actor will handle serialization, type conversion and other local problems withing journal.
Exceptions
Type | Condition |
---|---|
ArgumentException | When |