Skip to content

Multiple subscriptions to the same topic within a single application #1656

@akolodkin

Description

@akolodkin

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
// ❌ Only the first handler would be registered
[Topic("pubsub", "deposit")]
[HttpPost("deposit/accounting")]
public async Task<ActionResult> DepositAccounting(Transaction t) { }

[Topic("pubsub", "deposit")]  // ❌ Ignored with error
[HttpPost("deposit/notifications")]
public async Task<ActionResult> DepositNotifications(Transaction t) { }

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions