Skip to content

Commit

Permalink
adding missing queueName (dapr#4125)
Browse files Browse the repository at this point in the history
Signed-off-by: Hannah Hunter <[email protected]>
Co-authored-by: Yaron Schneider <[email protected]>
  • Loading branch information
hhunter-ms and yaron2 authored May 2, 2024
1 parent 0bfa02b commit bacfeae
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,15 @@ For example, if installing using the example above, the RabbitMQ server client a

## Use topic exchange to route messages

Setting `exchangeKind` to `"topic"` uses the topic exchanges, which are commonly used for the multicast routing of messages.
Messages with a `routing key` will be routed to one or many queues based on the `routing key` defined in the metadata when subscribing.
The routing key is defined by the `routingKey` metadata. For example, if an app is configured with a routing key `keyA`:
Setting `exchangeKind` to `"topic"` uses the topic exchanges, which are commonly used for the multicast routing of messages. In order to route messages using topic exchange, you must set the following metadata:

- **`routingKey`:**
Messages with a routing key are routed to one or many queues based on the `routing key` defined in the metadata when subscribing.

- **`queueName`:**
If you don't set the `queueName`, only one queue is created, and all routing keys will route to that queue. This means all subscribers will bind to that queue, which won't give the desired results.

For example, if an app is configured with a routing key `keyA` and `queueName` of `queue-A`:

```yaml
apiVersion: dapr.io/v2alpha1
Expand All @@ -223,6 +229,7 @@ spec:
pubsubname: pubsub
metadata:
routingKey: keyA
queueName: queue-A
```

It will receive messages with routing key `keyA`, and messages with other routing keys are not received.
Expand Down

0 comments on commit bacfeae

Please sign in to comment.