mirror of https://github.com/dapr/docs.git
update for multi pubsub (#751)
Co-authored-by: LM <lemai> Co-authored-by: Charlie Stanley <charlie.stanley@microsoft.com>
This commit is contained in:
parent
21f5bd57b5
commit
a667eb4d12
|
@ -19,7 +19,7 @@ For this guide, we'll use Redis Streams, which is also installed by default on a
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: messagebus
|
name: pubsub
|
||||||
namespace: default
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: pubsub.redis
|
type: pubsub.redis
|
||||||
|
@ -50,6 +50,7 @@ const port = 3000
|
||||||
<b>app.get('/dapr/subscribe', (req, res) => {
|
<b>app.get('/dapr/subscribe', (req, res) => {
|
||||||
res.json([
|
res.json([
|
||||||
{
|
{
|
||||||
|
pubsubname: "pubsub",
|
||||||
topic: "newOrder",
|
topic: "newOrder",
|
||||||
route: "orders",
|
route: "orders",
|
||||||
pubsubName: "messagebus"
|
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) => {
|
app.get('/dapr/subscribe', (req, res) => {
|
||||||
res.json([
|
res.json([
|
||||||
{
|
{
|
||||||
|
pubsubname: "pubsub",
|
||||||
topic: "onCreated",
|
topic: "onCreated",
|
||||||
route: "custom/path",
|
route: "custom/path",
|
||||||
pubsubName: "messagebus"
|
pubsubName: "messagebus"
|
||||||
|
|
|
@ -35,7 +35,7 @@ Now, configure `deploy/redis.yaml`, paying attention to the hostname containing
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: messagebus
|
name: pubsub
|
||||||
namespace: default
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: pubsub.redis
|
type: pubsub.redis
|
||||||
|
|
|
@ -29,7 +29,7 @@ Here is an example of three applications and three topics:
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: messagebus
|
name: pubsub
|
||||||
namespace: default
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: pubsub.redis
|
type: pubsub.redis
|
||||||
|
@ -73,7 +73,7 @@ Here is an example of three allowed topics:
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: messagebus
|
name: pubsub
|
||||||
namespace: default
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: pubsub.redis
|
type: pubsub.redis
|
||||||
|
@ -97,7 +97,7 @@ Here is an example of three applications and two topics:
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: messagebus
|
name: pubsub
|
||||||
namespace: default
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: pubsub.redis
|
type: pubsub.redis
|
||||||
|
@ -129,3 +129,5 @@ The table below shows which application is allowed to subscribe to the topics:
|
||||||
| B | | | X |
|
| B | | | X |
|
||||||
|
|
||||||
No other topics can be used, only A and B.
|
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.
|
||||||
|
|
Loading…
Reference in New Issue