Repository navigation
v7: UseNats with options from configuration, and headers over NATS - #118
Merged
Merged
Conversation
Adds UseNats(IConfiguration) and UseNats(Action<NatsOptions>) for AddObvs, with startup checks for a missing server address or serializer. Each service on each bus gets its own connection, since v6's shared connections are process-wide. Message headers, including trace context, now travel as NATS headers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 25, 2026
This was referenced Oct 26, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Next v7 increment:
UseNats()for #84, following theUseRabbitMq()pattern from #112. It also carries message headers, including trace context (#90, as in #116), over NATS. Targetsv7.API
NatsOptionshasUrl(required). Each service's settings are named options keyed by the service name:IOptionsMonitor<NatsOptions>.Get("orders").ObvsConfigurationExceptionas any other problem. The message names the configuration key to set (for exampleObvs:Orders:Nats:Url) or the method to call.Headers over NATS
ObvsMessageHeadersas NATS headers. A message without headers is sent as before.processspan continues the sender's trace, and headers the app sets arrive intact.Tests (written first)
Obvs.NATS.Tests/Hosting/TestUseNats.cs. They cover options from configuration and from code, a missing URL (in configuration and in code), and a missing serializer.Explicit, real server): 6 tests inTestNatsHosting.cs. They cover:HandleRequestandRequestAsync;UseNatsexisted. OnceUseNatsworked, the two header tests still failed for their real reasons, a missingx-tenantheader and a different trace ID, until headers were carried.nats-server.Not in this increment
Use<Transport>()and header support for Kafka, ActiveMQ and NetMQ.🤖 Generated with Claude Code