Dapr already allows us to subscribe multiple apps to a topic declaratively.
But can we use just one subscription.yaml
file to subscribe an app to multiple topics declaratively?
Something like:
apiVersion: dapr.io/v1alpha1
kind: Subscription
metadata:
name: myevent-subscription
spec:
- topic: newOrder
route: /orders
pubsubname: pubsub
- topic: newProduct
route: /productCatalog/products
pubsubname: pubsub
scopes:
- myapp
I know how to subscribe an app to multiple topics programmatically, but "the declarative approach removes the Dapr dependency from your code and allows, for example, existing applications to subscribe to topics, without having to change code"¹ and it's what I want.