NexJob.Trigger.GooglePubSub
6.1.0
See the version list below for details.
dotnet add package NexJob.Trigger.GooglePubSub --version 6.1.0
NuGet\Install-Package NexJob.Trigger.GooglePubSub -Version 6.1.0
<PackageReference Include="NexJob.Trigger.GooglePubSub" Version="6.1.0" />
<PackageVersion Include="NexJob.Trigger.GooglePubSub" Version="6.1.0" />
<PackageReference Include="NexJob.Trigger.GooglePubSub" />
paket add NexJob.Trigger.GooglePubSub --version 6.1.0
#r "nuget: NexJob.Trigger.GooglePubSub, 6.1.0"
#:package NexJob.Trigger.GooglePubSub@6.1.0
#addin nuget:?package=NexJob.Trigger.GooglePubSub&version=6.1.0
#tool nuget:?package=NexJob.Trigger.GooglePubSub&version=6.1.0
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";
});
With EmulatorHost set, the trigger connects without TLS and without credentials. The repository tests the trigger against the real emulator image (gcr.io/google.com/cloudsdktool/cloud-sdk:emulators).
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" is the application's default queue ({prefix}.default) |
"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: it is nacked after a 2 second pause (so it is not redelivered in a tight loop) and logged as an error. Pub/Sub delivers a nacked message again, so give the subscription a dead-letter policy (a dead-letter topic with a maximum number of delivery attempts) to park such messages instead of redelivering them forever.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. |
-
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 (>= 6.1.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 |