MVFC.Outbox.GcpPubSub
1.0.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package MVFC.Outbox.GcpPubSub --version 1.0.0
NuGet\Install-Package MVFC.Outbox.GcpPubSub -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MVFC.Outbox.GcpPubSub" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MVFC.Outbox.GcpPubSub" Version="1.0.0" />
<PackageReference Include="MVFC.Outbox.GcpPubSub" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MVFC.Outbox.GcpPubSub --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: MVFC.Outbox.GcpPubSub, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MVFC.Outbox.GcpPubSub@1.0.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MVFC.Outbox.GcpPubSub&version=1.0.0
#tool nuget:?package=MVFC.Outbox.GcpPubSub&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
MVFC.Outbox.GcpPubSub
Português · Main guide · Playground · Apache-2.0
GCP Pub/Sub transport for MVFC.Outbox through Wolverine and Google's native emulator detection.
Supports .NET 10 and .NET 11.
dotnet add package MVFC.Outbox.GcpPubSub
Configuration and usage
Snippets use application services and variables: services, configuration, connection, ct, order and topicId. Register services before building the host and resolve IOutboxPublisher and your DbContext in the same DI scope.
using Microsoft.Extensions.DependencyInjection;
using Google.Api.Gax;
using MVFC.Outbox.DependencyInjection;
using MVFC.Outbox.GcpPubSub;
using MVFC.Outbox.PostgreSql;
using MVFC.Outbox.Publishing;
services.AddOutbox(configuration, outbox => outbox.ConsumerProducer()
.MapAggregate<Order, Guid>(order => order.Id, "order")
.UsePostgreSql<ApplicationDbContext>(connection)
.UseGcpPubSub(pubsub =>
{
pubsub.ProjectId = "my-project";
pubsub.EmulatorDetection = EmulatorDetection.EmulatorOrProduction;
pubsub.AutoProvision = false;
}));
var created = Guid.Parse("78214bd7-451a-4896-88be-08d7fcfdc32a");
var audited = Guid.Parse("3b914e8e-e144-4f70-a520-e7d30dbe5bca");
await publisher.For(order).To(created, audited).EnqueueAsync(ct);
await database.SaveChangesAsync(ct);
Topics and routes
{
"Outbox": {
"Topics": {
"78214bd7-451a-4896-88be-08d7fcfdc32a": "orders-created",
"3b914e8e-e144-4f70-a520-e7d30dbe5bca": "orders-audited"
},
"HandlerRoutes": {
"a6d21ecc-9cd9-4486-8174-e7f3cae7acb8": "order"
}
}
}
Emulator, credentials, and per-publication project overrides
- Emulator vs production: locally, set
PUBSUB_EMULATOR_HOST=localhost:8085.EmulatorDetection.EmulatorOrProductiontargets the emulator when that variable is present and uses Application Default Credentials (ADC) in production.AutoProvision = falserequires topics to exist beforehand. - Per-publication project override: calling
.WithProjectId("billing-project")routes that publication throughGcpPubSubOutboxSenderto"billing-project"while keeping the physical topic name resolved fromOutbox:Topics[GUID], using the same configured credentials/emulator. Ensure the topic exists and permissions are granted in that project. - Custom attributes & reserved headers: every published message includes
outbox-message-id,outbox-topic-id,aggregate-id,aggregate-typeandschema-version, plus any.WithAttributes(...)entries (which cannot overwrite those reserved keys). - Delivery semantics & quotas:
Processedmeans broker acceptance, not consumer execution. Delivery is at least once; consumers must deduplicate usingoutbox-message-id. KeepMaximumPayloadBytes(default1,000,000UTF-8 bytes) small enough to accommodate Pub/Sub attribute overhead, and ensureLeaseDurationexceedsPublishTimeout.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. net11.0 is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Microsoft.Extensions.Hosting (>= 10.0.15)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.15)
- MVFC.Outbox.Wolverine (>= 1.0.0)
- WolverineFx (>= 6.66.0)
- WolverineFx.Pubsub (>= 6.66.0)
- WolverineFx.RuntimeCompilation (>= 6.66.0)
-
net11.0
- Microsoft.Extensions.Hosting (>= 11.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 11.0.0)
- MVFC.Outbox.Wolverine (>= 1.0.0)
- WolverineFx (>= 6.66.0)
- WolverineFx.Pubsub (>= 6.66.0)
- WolverineFx.RuntimeCompilation (>= 6.66.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.