Update pubsub.md (#399)

Hopefully this change makes it a bit more clear as to what is part of the Dapr HTTP API and what is required in user code to support said API.
This commit is contained in:
Lynn Orrell 2020-03-08 16:01:03 -05:00 committed by GitHub
parent 331f8c0396
commit e50f1f6725
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -33,9 +33,11 @@ curl -X POST http://localhost:3500/v1.0/publish/deathStarStatus \
}'
```
## Handling topic subscriptions
# Required Application (User Code) Routes
In order to receive topic subscriptions, Dapr will invoke the following endpoint on user code:
## Provide a route for Dapr to discover topic subscriptions
Dapr will invoke the following endpoint on user code to discover topic subscriptions:
### HTTP Request
@ -59,9 +61,9 @@ Example:
"["TopicA","TopicB"]"
```
## Delivering events to subscribers
## Provide route(s) for Dapr to deliver topic events
In order to deliver events to a subscribed application, a `POST` call should be made to user code with the name of the topic as the URL path.
In order to deliver topic events, a `POST` call will be made to user code with the name of the topic as the URL path.
The following example illustrates this point, considering a subscription for topic `TopicA`: