BareWire.Transport.Google.PubSub
2.0.4
dotnet add package BareWire.Transport.Google.PubSub --version 2.0.4
NuGet\Install-Package BareWire.Transport.Google.PubSub -Version 2.0.4
<PackageReference Include="BareWire.Transport.Google.PubSub" Version="2.0.4" />
<PackageVersion Include="BareWire.Transport.Google.PubSub" Version="2.0.4" />
<PackageReference Include="BareWire.Transport.Google.PubSub" />
paket add BareWire.Transport.Google.PubSub --version 2.0.4
#r "nuget: BareWire.Transport.Google.PubSub, 2.0.4"
#:package BareWire.Transport.Google.PubSub@2.0.4
#addin nuget:?package=BareWire.Transport.Google.PubSub&version=2.0.4
#tool nuget:?package=BareWire.Transport.Google.PubSub&version=2.0.4
BareWire.Transport.Google.PubSub
Google Cloud Pub/Sub transport adapter for BareWire. Implements ITransportAdapter using the low-level PublisherServiceApiClient / SubscriberServiceApiClient from Google.Cloud.PubSub.V1 3.x.
Capabilities
| Capability | Status | Notes |
|---|---|---|
OrderingKeys |
Declared (R5.1) | BW-OrderingKey header passed through to PubsubMessage.OrderingKey. Full CorrelationId→ordering key mapping in R5.2. |
BatchReceive |
Active | Pull supports maxMessages > 1. |
DlqNative |
Implemented (R5.3) | DeadLetterPolicy applied to subscriptions during topology deployment when bw.pubsub.dead-letter-topic / bw.pubsub.max-delivery-attempts arguments are set. The subscription's service account requires roles/pubsub.publisher on the dead-letter topic (environment config, verified in R5.4). |
FlowControl |
Active | MaxOutstandingMessages / MaxOutstandingBytes map 1:1 to FlowControlOptions. |
Configuration
services.AddBareWirePubSub(cfg =>
{
cfg.ProjectId("my-gcp-project");
cfg.UseApplicationDefaultCredentials(); // default — uses Google ADC
cfg.AckDeadline(TimeSpan.FromSeconds(60));
cfg.MaxOutstandingMessages(1000);
cfg.MaxInFlightMessages(100);
});
Service account JSON key
services.AddBareWirePubSub(cfg =>
{
cfg.ProjectId("my-gcp-project");
cfg.UseServiceAccountJson("/etc/secrets/sa.json"); // file path
// or: cfg.UseServiceAccountJsonContent(jsonString); // inline (never log the content)
});
Local emulator
services.AddBareWirePubSub(cfg =>
{
cfg.ProjectId("test-project");
cfg.UseEmulator("localhost:8085"); // sets AuthMode = EmulatorInsecure
});
Flow control 1:1 mapping
BareWire FlowControlOptions |
Pub/Sub equivalent |
|---|---|
MaxInFlightMessages (registry limit) |
In-flight registry size — messages above this are not pulled |
MaxOutstandingMessages (options) |
maxMessages per Pull call — limits outstanding message count |
InternalQueueCapacity (flow control) |
Bounded Channel<InboundMessage> capacity |
Header mapping
BareWire headers are stored in PubsubMessage.Attributes (string→string). Pub/Sub limits:
- Max 100 attributes per message
- Key ≤ 256 UTF-8 bytes; value ≤ 1024 UTF-8 bytes
Violations throw BareWireTransportException with only counts/lengths — never key text or values (SEC-4).
Ordering keys (R5.1)
If the inbound or outbound message has a BW-OrderingKey header, it is passed through to/from PubsubMessage.OrderingKey. Full CorrelationId→ordering key mapping is implemented in R5.2.
Security note: Do not log
ServiceAccountJsonPathfile contents. The path itself is safe to log; the key material is not.
Roadmap
- R5.2 — Full ordering key support:
CorrelationId→PubsubMessage.OrderingKey, resume-on-failure (ResumePublish). R5.3 — Dead-letter topic wiring:Done.DeadLetterPolicyapplied to subscriptions frombw.pubsub.dead-letter-topic/bw.pubsub.max-delivery-attemptstopology arguments.- R5.4 — Integration tests against the Pub/Sub emulator via Aspire.
| 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. |
-
net10.0
- BareWire.Abstractions (>= 2.0.4)
- Google.Cloud.PubSub.V1 (>= 3.27.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.1)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on BareWire.Transport.Google.PubSub:
| Package | Downloads |
|---|---|
|
BareWire.Benchmarks
Package Description |
|
|
BareWire.Google.PubSub
Single-call registration bundle for BareWire with the Google Cloud Pub/Sub transport. References both the BareWire core and BareWire.Transport.Google.PubSub and exposes AddBareWireWithPubSub. |
GitHub repositories
This package is not used by any popular GitHub repositories.