mirror of https://github.com/dapr/docs.git
parent
cc715c865d
commit
5436651203
|
@ -66,9 +66,12 @@ spec:
|
|||
## Step 2: Subscribe to topics
|
||||
|
||||
Dapr allows two methods by which you can subscribe to topics:
|
||||
|
||||
- **Declaratively**, where subscriptions are are defined in an external file.
|
||||
- **Programatically**, where subscriptions are defined in user code
|
||||
|
||||
> Note, both, declarative and programatic approaches support the same features. The decelrative approach removes the Dapr dependancy from the user code and allows for the use of an existing application to subscribe to topic. The programmatic approach implements the subscription in user code.
|
||||
|
||||
### Declarative subscriptions
|
||||
|
||||
You can subscribe to a topic using the following Custom Resources Definition (CRD). Create a file named `subscription.yaml` and paste the following:
|
||||
|
|
Loading…
Reference in New Issue