NexJob.Trigger.GooglePubSub
5.6.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 NexJob.Trigger.GooglePubSub --version 5.6.0
NuGet\Install-Package NexJob.Trigger.GooglePubSub -Version 5.6.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="NexJob.Trigger.GooglePubSub" Version="5.6.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NexJob.Trigger.GooglePubSub" Version="5.6.0" />
<PackageReference Include="NexJob.Trigger.GooglePubSub" />
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 NexJob.Trigger.GooglePubSub --version 5.6.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: NexJob.Trigger.GooglePubSub, 5.6.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 NexJob.Trigger.GooglePubSub@5.6.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=NexJob.Trigger.GooglePubSub&version=5.6.0
#tool nuget:?package=NexJob.Trigger.GooglePubSub&version=5.6.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
NexJob.Trigger.GooglePubSub
Google Cloud Pub/Sub trigger for NexJob. Receives messages from a Pub/Sub subscription and automatically enqueues them as NexJob jobs.
Installation
dotnet add package NexJob.Trigger.GooglePubSub
Usage
Subscription Setup
using NexJob.Trigger.GooglePubSub;
builder.Services.AddNexJobGooglePubSubTrigger(options =>
{
options.ProjectId = "my-gcp-project";
options.SubscriptionId = "my-subscription";
options.TargetQueue = "default";
});
Local Development with Pub/Sub Emulator
builder.Services.AddNexJobGooglePubSubTrigger(options =>
{
options.ProjectId = "local-project";
options.SubscriptionId = "local-subscription";
options.EmulatorHost = "localhost:8085";
});
Strongly-Typed Consumer Registration
builder.Services.AddNexJobGooglePubSubTrigger<ProcessPubSubJob>(options =>
{
options.ProjectId = "my-gcp-project";
options.SubscriptionId = "my-subscription";
});
Operational Visibility
This trigger registers with IListenerRegistry to report live connection states (Starting, Listening, Faulted, Stopped) directly to the Dashboard /listeners page and the Cluster Pipeline Topology Map.
Configuration Options
| Option | Description | Default |
|---|---|---|
ProjectId |
Google Cloud Project ID (required) | "" |
SubscriptionId |
Pub/Sub Subscription ID (required) | "" |
TargetQueue |
Target NexJob queue name | "default" |
JobPriority |
Execution priority for enqueued jobs | JobPriority.Normal |
EmulatorHost |
Optional emulator endpoint (e.g. localhost:8085) |
null |
Message Contract
The trigger expects messages with the following properties:
- Data: The job input payload as a UTF-8 string (JSON).
- Attributes:
nexjob.job_type: Assembly-qualified name of the job implementation type. Optional when the subscriber setsoptions.JobTypeor registers the trigger withAddNexJobGooglePubSubTrigger<TJob>(); the attribute wins when both are present. A message with neither can never become a job.traceparent: W3C traceparent header for distributed tracing (optional).
Broker Guarantees
This trigger satisfies all canonical NexJob trigger guarantees:
- At-least-once delivery — messages are delivered via pull subscription and acknowledged only after successful enqueue.
- Explicit Ack / Nack — returns
SubscriberClient.Reply.Ackstrictly afterIScheduler.EnqueueAsynccompletes. On enqueue failure, returnsSubscriberClient.Reply.Nackto allow reprocessing. - Trace propagation — extracts W3C
traceparentfrom message attributes and assigns it toJobRecord.TraceParent. - Idempotency — uses native Pub/Sub
MessageIdas theJobRecord.IdempotencyKey. - Graceful shutdown — respects cancellation token during host shutdown, nacking any in-flight messages so they can be picked up after restart.
Publishing Example
var publisher = await PublisherClient.CreateAsync(TopicName.FromProjectTopic("my-gcp-project", "my-topic"));
var message = new PubsubMessage
{
Data = ByteString.CopyFromUtf8(jsonPayload),
Attributes =
{
["nexjob.job_type"] = typeof(OrderProcessingJob).AssemblyQualifiedName,
["traceparent"] = Activity.Current?.Id ?? string.Empty,
},
};
await publisher.PublishAsync(message);
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- Google.Cloud.PubSub.V1 (>= 3.18.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.3)
- Microsoft.Extensions.Options (>= 8.0.2)
- Microsoft.Extensions.Options.DataAnnotations (>= 8.0.0)
- NexJob (>= 5.6.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 6.7.0 | 78 | 10/19/2026 |
| 6.6.0 | 82 | 10/18/2026 |
| 6.5.1 | 90 | 10/17/2026 |
| 6.5.0 | 82 | 10/17/2026 |
| 6.4.0 | 90 | 10/16/2026 |
| 6.3.0 | 81 | 10/12/2026 |
| 6.2.1 | 87 | 10/11/2026 |
| 6.2.0 | 89 | 10/10/2026 |
| 6.1.0 | 88 | 10/10/2026 |
| 6.0.0 | 87 | 10/9/2026 |
| 5.10.0 | 89 | 10/8/2026 |
| 5.9.0 | 96 | 10/5/2026 |
| 5.8.0 | 104 | 10/4/2026 |
| 5.7.0 | 91 | 10/1/2026 |
| 5.6.2 | 92 | 10/1/2026 |
| 5.6.1 | 95 | 9/30/2026 |
| 5.6.0 | 90 | 9/30/2026 |
| 5.5.0 | 97 | 9/25/2026 |
| 5.4.1 | 92 | 9/24/2026 |
| 5.4.0 | 90 | 9/24/2026 |
Loading failed