Update NATS.Net to 3.2.0 - #20043
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 20043Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 20043" |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Approved-feed restore fails until the new transitive dependency is mirrored and validation succeeds.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Balanced
Findings: 1
New issues introduced by this change (1)
| Severity | Finding |
|---|---|
Directory.Packages.props — Mirror the new transitive dependency before merging |
What changed in this PR
Updates the NATS client integration from 2.8.0 to 3.2.0 and documents compatibility considerations.
Changes:
- Upgrades the centrally managed NATS.Net dependency.
- Documents changed defaults and interface requirements.
| File | Description |
|---|---|
Directory.Packages.props |
Updates NATS.Net to 3.2.0. |
src/Components/Aspire.NATS.Net/README.md |
Adds NATS.Net 3 migration guidance. |
| <PackageVersion Include="MySqlConnector.DependencyInjection" Version="2.5.0" /> | ||
| <PackageVersion Include="MySqlConnector.Logging.Microsoft.Extensions.Logging" Version="2.1.0" /> | ||
| <PackageVersion Include="NATS.Net" Version="2.8.0" /> | ||
| <PackageVersion Include="NATS.Net" Version="3.2.0" /> |
Tests selectorSelects the full PR test matrix + all PR-gated jobs (ALL) — a rule matching 'Directory.Packages.props' selects ALL Advisory workflow impact (4)
Selection computed for commit |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |

Description
Updates the NATS client dependency to NATS.Net 3.2.0 in a separate, rollbackable change because the upstream major version has narrow source and concurrency compatibility considerations.
The Aspire integration continues to construct
NatsOpts.DefaultandNatsConnection, so it intentionally inherits NATS.Net 3 defaults:Directmode instead ofSharedInbox, with request/reply semantics preserved. Applications can opt back intoSharedInboxthroughconfigureOptions.BoundedChannelFullMode.DropNewest; the pending capacity increases from 1,024 to 16,384.The existing Aspire tracing registration remains unchanged. NATS.Net 3 still emits activities from the
"NATS.Net"source, so the currentAddSource("NATS.Net")registration remains valid. NATS.Net 3 also introduces a meter with that name, but registering new metrics is intentionally left out of this dependency-only PR because it would be a separate Aspire feature and configuration-surface change.Breaking changes
Ordinary
INatsClient,INatsConnection, and JetStream callers are not affected by an API break. The source break is limited to applications and test fakes that directly implementINatsJSStreamorINatsJSConsumer; they must add the members introduced in NATS.Net 3.2:NATS.Net 3 no longer marks
NatsHeadersread-only after publishing. A single headers instance must not be reused across concurrent publishes because the writer and context-aware serializers can access or mutate it concurrently. Create a freshNatsHeadersinstance per publish, or wait for one publish to complete before reusing it:To restore the previous request/reply implementation:
Upstream release notes:
Rollback is a single PR revert, restoring the NATS.Net 2.8.x dependency.
Dependency availability
NATS.Net 3.2.0 is present in
dotnet-public, but its new transitive dependencyNATS.Extensions.Microsoft.DependencyInjection3.2.0 is not. Approved-feed restore currently fails withNU1101until that package is mirrored. No mirror pipeline was queued because the parent dependency-update run is paused after an unrelated intermediate quarantine failure.Validation
Approved-feed validation is blocked before compilation: a forced, no-cache restore of
Aspire.NATS.Net.Testsfails becauseNATS.Extensions.Microsoft.DependencyInjection3.2.0 is unavailable from the approved feeds. Therefore, this PR currently has no build or test result that counts toward readiness.A temporary local package source was used during investigation before this restriction was clarified. Those results are intentionally excluded from readiness claims; the local source, package artifact, and validation config were removed and are not committed.
Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?