Skip to content

Conversation

@thompson-tomo
Copy link
Contributor

@thompson-tomo thompson-tomo commented Jun 3, 2025

This does some basic refactoring to move the reply task handler to subscription manager so that it can also leverage subscription metadata which is needed for OTEL #871

thompson-tomo and others added 3 commits May 27, 2025 12:43
* nats-io#848 Tweak dependencies

Signed-off-by: James Thompson <[email protected]>

* Update NATS.Client.Core.csproj

Signed-off-by: James Thompson <[email protected]>

* Update NATS.Client.Core.csproj

Signed-off-by: James Thompson <[email protected]>

* Make STJ explicit dependency for JetStream

Signed-off-by: James Thompson <[email protected]>

* Update NATS.Client.JetStream.csproj

Signed-off-by: James Thompson <[email protected]>

* Force sdk to 8.0.0

Signed-off-by: James Thompson <[email protected]>

* Add newer stj for net 6

Signed-off-by: James Thompson <[email protected]>

---------

Signed-off-by: James Thompson <[email protected]>
@thompson-tomo thompson-tomo changed the title Move direct reply handling to be in subscription manager WIP: Move direct reply handling to be in subscription manager Jun 3, 2025
@thompson-tomo thompson-tomo marked this pull request as draft June 3, 2025 12:32
@thompson-tomo thompson-tomo force-pushed the Task/DemoteReplyFactory branch 2 times, most recently from 6813636 to d22fe57 Compare June 4, 2025 00:27
if (_bySid.TryGetValue(sid, out var sidMetadata))
{
// this could come from sidMetadata in the future once records are available
if (_connection.Opts.RequestReplyMode == NatsRequestReplyMode.Direct)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this should be outside the _bySid check and the lock, no? whole ide of this is to side step the subscription manager internals completely to increase request-reply efficiency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes and no, part of the reason for the change was to get access to the metadata based on subscription id. That metadata can then be used as well as associated with the span etc.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair enough. keep in mind we also must make sure the impact to apps not using otel must be bare minimum like a simple bool check

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted, the usage for the metadata is not limited to OTEL but general usage as well.

mtmk and others added 2 commits June 6, 2025 14:01
…ats-io#859)

* Add support for `Filter` and `Enrich` for OpenTelemetry activities

* Make `internal` methods in `internal Telemetry` `public`

* Fix package versions and whatnot

* Remove `TracerProviderBuilderExtensions`

* Include `Deserialize` in the receive activity

* Revert back accidental change

* Add `ParentContext` to `NatsInstrumentationContext`

* Make `GetActivityContext` public to provide the ability to get context activity context

* Make preprocessor directive more accurate

* Revert .csproj formatting

* Move public artifacts out of the `Internal` namespace/folder

* Fix build script

---------

Co-authored-by: Ziya Suzen <[email protected]>
@thompson-tomo thompson-tomo force-pushed the Task/DemoteReplyFactory branch from d22fe57 to bd27cae Compare June 10, 2025 01:45
@thompson-tomo thompson-tomo force-pushed the Task/DemoteReplyFactory branch from bd27cae to 1558878 Compare June 10, 2025 03:32
@mtmk
Copy link
Member

mtmk commented Jan 5, 2026

release/2.7 branch is obsolete now. need to move this change to base main.

@mtmk mtmk added the obsolete-merge-base Merge base branch is not active anymore e.g. release/2.7 branch label Jan 5, 2026
@thompson-tomo thompson-tomo changed the base branch from release/2.7 to main January 8, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

obsolete-merge-base Merge base branch is not active anymore e.g. release/2.7 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants