"No Async outbox defined" when using PostgreSqlOutbox #3795
-
|
When using the Postgres outbox, I'm getting the following error: Code sample is following a combination of branches from here: https://github.com/lillo42/brighter-sample/blob/v10-outbox-postgres/Program.cs to combine Kafka with outbox. I looked through the codebase and // Snip usings....
public static class SetupBrighterKafkaExtensions
{
private static string connectionString =>
Environment.GetEnvironmentVariable("ConnectionStrings__webapipg") ?? "";
public static IServiceCollection AddBrighterWithKafka(
this IServiceCollection services
)
{
var kafka = new KafkaProducerRegistryFactory(
new KafkaMessagingGatewayConfiguration
{
Name = "brighter-kafka",
BootStrapServers =
[
Environment.GetEnvironmentVariable("ConnectionStrings__kafka")
?? ""
],
SecurityProtocol = SecurityProtocol.Plaintext
},
[
// TODO: Create one for each publish topic.
new KafkaPublication
{
MakeChannels = OnMissingChannel.Create,
Source = new Uri("aspire-kafka", UriKind.RelativeOrAbsolute),
Topic = new RoutingKey("email.topic")
}
]
).Create();
var db = new RelationalDatabaseConfiguration(
connectionString,
"brightertests"
);
var outbox = new PostgreSqlOutbox(db);
var inbox = new PostgreSqlInbox(db);
services
.AddHostedService<ServiceActivatorHostedService>()
.AddSingleton<IAmARelationalDatabaseConfiguration>(db)
.AddSingleton<IAmAnOutbox>(outbox)
.AddConsumers(options =>
{
options.InboxConfiguration = new InboxConfiguration(inbox);
options.Subscriptions =
[
// TODO: Auto generate one for each consumer
new KafkaSubscription<EmailReceivedModel>(
new SubscriptionName("email.topic.sub"),
new ChannelName("email"),
new RoutingKey("email.topic"),
groupId: "email-consumer",
makeChannels: OnMissingChannel.Create,
messagePumpType: MessagePumpType.Reactor
)
];
})
.AutoFromAssemblies([Assembly.GetExecutingAssembly()])
.AddProducers(options =>
{
options.Outbox = outbox;
options.ProducerRegistry = kafka;
})
.UseOutboxSweeper(options =>
{
options.BatchSize = 10;
})
.UseOutboxArchiver<DbTransaction>(
new NullOutboxArchiveProvider(),
opt => opt.MinimumAge = TimeSpan.FromMinutes(1)
);
return services;
}
}(Side note: from those examples, I also cannot find the Wondering if I've missed something. Is there a better source for up-to-date examples on how it should work? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 8 replies
-
|
The |
Beta Was this translation helpful? Give feedback.
-
|
Try to set the Just to confirm, are you using Brighter V10 preview 9? |
Beta Was this translation helpful? Give feedback.
-
|
Off-Topic question, I saw in your repo that you have set up Brighter and Wolverine. How difficult have you found it to set up/use Brighter? |
Beta Was this translation helpful? Give feedback.
Try to set the
ConnectionProviderandTransactionProvideronAddProducersJust to confirm, are you using Brighter V10 preview 9?