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 |
---|---|
System.Threading.Tasks.Task | A System.Threading.Tasks.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 |
---|---|
System.Threading.Tasks.Task | A System.Threading.Tasks.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 |
---|---|---|
System.Object | message | The message to be delivered. |
System.Byte[] | messageBytes | The actual serialized message to be delivered. |
System.Collections.Generic.IReadOnlyCollection<MessageHeader> | headers | The message headers. |
System.String | endpointName | The name of the configured endpoint to produce to. |
System.String | actualEndpointName | The actual endpoint to produce to. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A System.Threading.Tasks.Task representing the asynchronous operation. |