quickstarts/pub_sub/javascript/sdk
tanvigour a5b8b58ed3
Fix pubsub JS tests (#582)
Signed-off-by: tanvigour <tanvi.gour@gmail.com>
2022-03-08 12:14:45 -08:00
..
checkout Changed loop from while to for (#537) 2022-02-17 11:52:39 -08:00
order-processor Add http example for JavaScript pubsub 2022-02-14 15:57:15 -08:00
README.md Fix pubsub JS tests (#582) 2022-03-08 12:14:45 -08: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 publisher with Dapr

  1. Install dependencies:
cd pub_sub/javascript/sdk/checkout
npm install
  1. Run the Node publisher app with Dapr:
dapr run --app-id checkout --components-path pub_sub/components/  --app-port 5001 -- node pub_sub/javascript/sdk/checkout/

Run Node message subscriber with Dapr

  1. Install dependencies:
cd pub_sub/javascript/sdk/order-processor
npm install
  1. Run the Node publisher app with Dapr:
dapr run --app-id checkout --components-path pub_sub/components/  --app-port 5001 -- node pub_sub/javascript/sdk/order-processor/