mirror of
https://github.com/taigrr/nats.docs
synced 2025-01-18 04:03:23 -08:00
Update queues.md
This commit is contained in:
parent
fd8da6db04
commit
6d86b2886e
@ -4,24 +4,10 @@ Subscribing to a queue group is only slightly different than subscribing to a su
|
||||
|
||||
Keep in mind that the queue groups in NATS are dynamic and do not require any server configuration. You can almost think of a regular subscription as a queue group of 1, but it is probably not worth thinking too much about that.
|
||||
|
||||
<div class="graphviz"><code data-viz="dot">
|
||||
digraph g {
|
||||
rankdir=LR
|
||||
publisher [shape=box, style="rounded", label="PUB updates"];
|
||||
subject [shape=circle, label="nats-server"];
|
||||
sub1 [shape=box, style="rounded", label="SUB updates workers"];
|
||||
sub2 [shape=box, style="rounded", label="SUB updates workers"];
|
||||
sub3 [shape=box, style="rounded", label="SUB updates workers"];
|
||||
|
||||
publisher -> subject [label="msgs 1,2,3"];
|
||||
subject -> sub1 [label="msg 2"];
|
||||
subject -> sub2 [label="msg 1"];
|
||||
subject -> sub3 [label="msg 3"];
|
||||
}
|
||||
</code></div>
|
||||

|
||||
|
||||
As an example, to subscribe to the queue `workers` with the subject `updates`:
|
||||
|
||||
!INCLUDE "../../_examples/subscribe_queue.html"
|
||||
|
||||
If you run this example with the publish examples that send to `updates`, you will see that one of the instances gets a message while the others you run won't. But the instance that receives the message will change.
|
||||
If you run this example with the publish examples that send to `updates`, you will see that one of the instances gets a message while the others you run won't. But the instance that receives the message will change.
|
||||
|
Loading…
x
Reference in New Issue
Block a user