From a667eb4d12a7ba5a71767cc9405bbc77ac24931b Mon Sep 17 00:00:00 2001 From: Leon Mai Date: Thu, 20 Aug 2020 09:51:44 -0700 Subject: [PATCH] update for multi pubsub (#751) Co-authored-by: LM Co-authored-by: Charlie Stanley --- howto/consume-topic/README.md | 4 +++- howto/pubsub-namespaces/README.md | 2 +- howto/pubsub-scopes/README.md | 8 +++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/howto/consume-topic/README.md b/howto/consume-topic/README.md index da146836c..a582f2ffa 100644 --- a/howto/consume-topic/README.md +++ b/howto/consume-topic/README.md @@ -19,7 +19,7 @@ For this guide, we'll use Redis Streams, which is also installed by default on a apiVersion: dapr.io/v1alpha1 kind: Component metadata: - name: messagebus + name: pubsub namespace: default spec: type: pubsub.redis @@ -50,6 +50,7 @@ const port = 3000 app.get('/dapr/subscribe', (req, res) => { res.json([ { + pubsubname: "pubsub", topic: "newOrder", route: "orders", pubsubName: "messagebus" @@ -76,6 +77,7 @@ To consume messages from a topic, start a web server in the programming language app.get('/dapr/subscribe', (req, res) => { res.json([ { + pubsubname: "pubsub", topic: "onCreated", route: "custom/path", pubsubName: "messagebus" diff --git a/howto/pubsub-namespaces/README.md b/howto/pubsub-namespaces/README.md index fc25c47e3..0adb07e15 100644 --- a/howto/pubsub-namespaces/README.md +++ b/howto/pubsub-namespaces/README.md @@ -35,7 +35,7 @@ Now, configure `deploy/redis.yaml`, paying attention to the hostname containing apiVersion: dapr.io/v1alpha1 kind: Component metadata: - name: messagebus + name: pubsub namespace: default spec: type: pubsub.redis diff --git a/howto/pubsub-scopes/README.md b/howto/pubsub-scopes/README.md index c2a6eee01..fae554e5c 100644 --- a/howto/pubsub-scopes/README.md +++ b/howto/pubsub-scopes/README.md @@ -29,7 +29,7 @@ Here is an example of three applications and three topics: apiVersion: dapr.io/v1alpha1 kind: Component metadata: - name: messagebus + name: pubsub namespace: default spec: type: pubsub.redis @@ -73,7 +73,7 @@ Here is an example of three allowed topics: apiVersion: dapr.io/v1alpha1 kind: Component metadata: - name: messagebus + name: pubsub namespace: default spec: type: pubsub.redis @@ -97,7 +97,7 @@ Here is an example of three applications and two topics: apiVersion: dapr.io/v1alpha1 kind: Component metadata: - name: messagebus + name: pubsub namespace: default spec: type: pubsub.redis @@ -129,3 +129,5 @@ The table below shows which application is allowed to subscribe to the topics: | B | | | X | No other topics can be used, only A and B. + +Pub/sub scopes are per pub/sub. You may have pub/sub component named `pubsub` that has one set of scopes, and another `pubsub2` with a different set. The name is the `metadata.name` field in the yaml.