This demo shows how to use the Dapr PubSub component.
Run the following command to start the demo:
Linux:
- Start publisher:
./start-publisher.sh
- Start subscriber:
./start-subscriber.sh
- Start invoker:
./start-invoker.sh
Windows:
./start-binding.ps1
Once all the services are running, use the sampleRequests.http
file to send request to the Publisher service.
The Publisher will log the request and the output will show
== APP == Requested greetings for <NAME>.
The Subscriber will handle the request and the output will show
== APP == Hi <NAME>!
Make sure to show how the DaprClient is injected using DI. Also show how to map the subscribed endpoints in the Subscriber service using:
app.UseCloudEvents();
app.UseEndpoints(endpoints => endpoints.MapSubscribeHandler());