You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/microservices/rabbitmq.md
+77-2
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,7 @@ The `options` property is specific to the chosen transporter. The <strong>Rabbit
48
48
<table>
49
49
<tr>
50
50
<td><code>urls</code></td>
51
-
<td>Connection urls</td>
51
+
<td>An array of connection URLs to try in order</td>
52
52
</tr>
53
53
<tr>
54
54
<td><code>queue</code></td>
@@ -68,7 +68,7 @@ The `options` property is specific to the chosen transporter. The <strong>Rabbit
68
68
</tr>
69
69
<tr>
70
70
<td><code>consumerTag</code></td>
71
-
<td>Consumer Tag Identifier (read more <a href="https://amqp-node.github.io/amqplib/channel_api.html#channel_consume" rel="nofollow" target="_blank">here</a>)</td>
71
+
<td>A name which the server will use to distinguish message deliveries for the consumer; mustn’t be already in use on the channel. It’s usually easier to omit this, in which case the server will create a random name and supply it in the reply. Consumer Tag Identifier (read more <a href="https://amqp-node.github.io/amqplib/channel_api.html#channel_consume" rel="nofollow" target="_blank">here</a>)</td>
72
72
</tr>
73
73
<tr>
74
74
<td><code>queueOptions</code></td>
@@ -82,6 +82,38 @@ The `options` property is specific to the chosen transporter. The <strong>Rabbit
82
82
<td><code>headers</code></td>
83
83
<td>Headers to be sent along with every message</td>
84
84
</tr>
85
+
<tr>
86
+
<td><code>replyQueue</code></td>
87
+
<td>Reply queue for the producer. Default is <code>amq.rabbitmq.reply-to</code></td>
88
+
</tr>
89
+
<tr>
90
+
<td><code>persistent</code></td>
91
+
<td>If truthy, the message will survive broker restarts provided it’s in a queue that also survives restarts</td>
92
+
</tr>
93
+
<tr>
94
+
<td><code>noAssert</code></td>
95
+
<td>When false, a queue will not be asserted before consuming</td>
96
+
</tr>
97
+
<tr>
98
+
<td><code>wildcards</code></td>
99
+
<td>Set to true only if you want to use Topic Exchange for routing messages to queues. Enabling this will allow you to use wildcards (*, #) as message and event patterns</td>
100
+
</tr>
101
+
<tr>
102
+
<td><code>exchange</code></td>
103
+
<td>Name for the exchange. Defaults to the queue name when "wildcards" is set to true</td>
104
+
</tr>
105
+
<tr>
106
+
<td><code>exchangeType</code></td>
107
+
<td>Type of the exchange. Default is <code>topic</code>. Valid values are <code>direct</code>, <code>fanout</code>, <code>topic</code>, and <code>headers</code></td>
108
+
</tr>
109
+
<tr>
110
+
<td><code>routingKey</code></td>
111
+
<td>Additional routing key for the topic exchange</td>
112
+
</tr>
113
+
<tr>
114
+
<td><code>maxConnectionAttempts</code></td>
115
+
<td>Maximum number of connection attempts. Applies only to the consumer configuration. -1 === infinite</td>
116
+
</tr>
85
117
</table>
86
118
87
119
#### Client
@@ -300,3 +332,46 @@ Similarly, you can access the server's underlying driver instance:
RabbitMQ supports the use of wildcards in routing keys to allow for flexible message routing. The `#` wildcard matches zero or more words, while the `*` wildcard matches exactly one word.
339
+
340
+
For example, the routing key `cats.#` matches `cats`, `cats.meow`, and `cats.meow.purr`. The routing key `cats.*` matches `cats.meow` but not `cats.meow.purr`.
341
+
342
+
To enable wildcard support in your RabbitMQ microservice, set the `wildcards` configuration option to `true` in the options object:
With this configuration, you can use wildcards in your routing keys when subscribing to events/messages. For example, to listen for messages with the routing key `cats.#`, you can use the following code:
0 commit comments