Class DbOutboxWriter
Stores the outbound messages into the database. Used by the OutboxProduceStrategy.
Implements
Inherited Members
Namespace: Silverback.Messaging.Outbound.TransactionalOutbox.Repositories
Assembly: Silverback.Integration.dll
Syntax
public class DbOutboxWriter : RepositoryBase<OutboxMessage>, IOutboxWriter
Constructors
| Improve this doc View sourceDbOutboxWriter(IDbContext)
Initializes a new instance of the DbOutboxWriter class.
Declaration
public DbOutboxWriter(IDbContext dbContext)
Parameters
Type | Name | Description |
---|---|---|
IDbContext | dbContext | The IDbContext to use as storage. |
Methods
| Improve this doc View sourceCommitAsync()
Called to commit the transaction, storing the pending messages to the outbox.
Declaration
public Task CommitAsync()
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
RollbackAsync()
Called to rollback the transaction, preventing the pending messages to be stored in the outbox.
Declaration
public Task RollbackAsync()
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
WriteAsync(object?, byte[]?, IReadOnlyCollection<MessageHeader>?, string, string)
Adds the message contained in the specified envelope to the outbox.
Declaration
public Task WriteAsync(object? message, byte[]? messageBytes, IReadOnlyCollection<MessageHeader>? headers, string endpointName, string actualEndpointName)
Parameters
Type | Name | Description |
---|---|---|
object | message | The message to be delivered. |
byte[] | messageBytes | The actual serialized message to be delivered. |
IReadOnlyCollection<MessageHeader> | headers | The message headers. |
string | endpointName | The name of the configured endpoint to produce to. |
string | actualEndpointName | The actual endpoint to produce to. |
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |