dotnet-sdk
dotnet-sdk copied to clipboard
Pubsub name only known at runtime
How do I subscribe to a topic where I only know the pubsub name or topic name at runtime? The [Topic] attribute only accepts constants, and cannot be populated with a value from a variable.
https://github.com/dapr/dotnet-sdk/blob/master/examples/AspNetCore/ControllerSample/CustomTopicAttribute.cs#L26
You can also use WithTopic like this: https://github.com/dapr/dotnet-sdk/blob/master/examples/AspNetCore/RoutingSample/Startup.cs#L106.
If you need truly programmatic subscriptions, those are not yet supported by Dapr. If you're just loading the name at runtime, this or the above post should work.
@danielgerlag - Do you need any more information?
Thanks that worked for me... but it was hard to find these examples.
@danielgerlag are you looking for examples to Subscribing in the pubsub docs here?