Skip to content

Commit 2055fed

Browse files
committed
allow tableDescriptor access
1 parent e918dfa commit 2055fed

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

src/Blumchen.DependencyInjection/Workers/Worker.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public abstract class Worker<T>(
2020
INamingPolicy namingPolicy,
2121
PublicationManagement.PublicationSetupOptions publicationSetupOptions,
2222
ReplicationSlotManagement.ReplicationSlotSetupOptions replicationSlotSetupOptions,
23+
Func<TableDescriptorBuilder,TableDescriptorBuilder> tableDescriptorBuilder,
2324
ILoggerFactory loggerFactory): BackgroundService where T : class
2425
{
2526
private readonly ILogger<Worker<T>> _logger = loggerFactory.CreateLogger<Worker<T>>();
@@ -45,6 +46,7 @@ await pipeline.ExecuteAsync(async token =>
4546
await using var cursor = subscription.Subscribe(builder =>
4647
builder
4748
.ConnectionString(databaseOptions.ConnectionString)
49+
.WithTable(tableDescriptorBuilder)
4850
.WithErrorProcessor(errorProcessor)
4951
.Handles<T, IHandler<T>>(handler)
5052
.NamingPolicy(namingPolicy)

src/Blumchen/MessageTableOptions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ public TableDescriptorBuilder MessageType(string name, int dimension = 250)
3333
return this;
3434
}
3535

36+
public TableDescriptorBuilder UseDefaults() => this;
37+
3638
public record MessageTable(string Name = MessageTable.DefaultName)
3739
{
3840
internal const string DefaultName = "outbox";

src/SubscriberWorker/SubscriberWorker.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ ILoggerFactory loggerFactory
2525
, namingPolicy
2626
, new PublicationManagement.PublicationSetupOptions($"{typeof(T).Name}_pub")
2727
, new ReplicationSlotManagement.ReplicationSlotSetupOptions($"{typeof(T).Name}_slot")
28+
, tableDescriptorBuilder => tableDescriptorBuilder.UseDefaults()
2829
, loggerFactory) where T : class;

0 commit comments

Comments
 (0)