quickstarts/pub_sub/javascript/sdk
Hannah Hunter 6d88455770
update from components path to resources path (#781)
Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>
Signed-off-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com>
Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2023-02-03 10:51:02 -08:00
..
checkout update from components path to resources path (#781) 2023-02-03 10:51:02 -08:00
order-processor update from components path to resources path (#781) 2023-02-03 10:51:02 -08:00
README.md update from components path to resources path (#781) 2023-02-03 10:51:02 -08:00
makefile Removed docker image prefix addition step 2022-07-25 12:28:57 -07:00

README.md

Dapr pub/sub

In this quickstart, you'll create a publisher microservice and a subscriber microservice to demonstrate how Dapr enables a publish-subcribe pattern. The publisher will generate messages of a specific topic, while subscribers will listen for messages of specific topics. See Why Pub-Sub to understand when this pattern might be a good choice for your software architecture.

Visit this link for more information about Dapr and Pub-Sub.

Note: This example leverages the Dapr client SDK. If you are looking for the example using only HTTP requests click here.

This quickstart includes one publisher:

  • Node client message generator checkout

And one subscriber:

  • Node subscriber order-processor

Run Node message subscriber with Dapr

  1. Install dependencies:
cd ./order-processor
npm install
  1. Run the Node publisher app with Dapr:
dapr run --app-port 5002 --app-id order-processing-sdk --app-protocol http --dapr-http-port 3501 --resources-path ../../../components -- npm run start

Run Node message publisher with Dapr

  1. Install dependencies:
cd ./checkout
npm install
  1. Run the Node publisher app with Dapr:
dapr run --app-id checkout-sdk --app-protocol http --dapr-http-port 3500 --resources-path ../../../components -- npm run start
dapr stop --app-id checkout-sdk
dapr stop --app-id order-processor-sdk