Skip to content

Conversation

@akolodkin
Copy link

#1656

The Issue

The Dapr .NET SDK currently does not support creating multiple subscriptions to the same topic within a single application using programmatic subscriptions (via the /dapr/subscribe endpoint). This limitation exists because:

  1. Subscriptions are uniquely identified only by pubsubName + topic - There is no subscription name field
  2. Multiple handlers for the same topic are not supported - Only the first endpoint is registered, others are ignored with an error
  3. The limitation only affects programmatic subscriptions - Declarative subscriptions (YAML) support metadata.name but programmatic subscriptions do not

Solution

Add subscription name support to allow multiple named subscriptions to the same topic within a single application.

@akolodkin akolodkin requested review from a team as code owners November 21, 2025 21:11
@WhitWaldo
Copy link
Contributor

Could you please sign your commits so it passes the DCO check?

I'm not quite following why you'd want this - do you just want to be able to kick off multiple callbacks in response to the same message? Is the point of the name just to differentiate locally (given that the runtime isn't providing it)?

@olitomlinson
Copy link

I would be very surprised if this was all that was required to enable multiple subscriptions to the same topic from the same app because there has been many attempts to discuss this on the runtime and its never resulted in anything.

IIRC Streaming Subscriptions is the way to go about, although I've not personally tested if this works (allows you to subscribe to the same topic more than once within an App)

cc @WhitWaldo

…ubscriptions per topic

Introduces subscription name support across topic metadata, attributes, and routing logic to allow multiple distinct subscriptions to the same topic within a single application.

Enhances topic attributes and subscription models with an optional subscription name to differentiate subscription handlers. Updates routing and subscription grouping to incorporate subscription names for precise subscription management.

Adds example handlers and integration tests demonstrating multiple subscriptions to the same topic distinguished by subscription names.

This improvement enables advanced pubsub scenarios where separate subscription handlers can independently process messages from the same topic without conflict.

Signed-off-by: Anatoliy Kolodkin <[email protected]>
@akolodkin akolodkin force-pushed the feature/subscription-name branch from 58e2075 to 1968918 Compare December 2, 2025 12:35
@WhitWaldo
Copy link
Contributor

I'm going to have to check with the runtime maintainers on this one. I can't find anything in the documentation that suggests this is something that's intended to be supported with traditional subscriptions. While it passes integration tests and presumably works against whatever pubsub provider you're using, I'm loathe to merge something into the SDK that works for some pubsub providers, but might not work for others as an open question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants