1
0
mirror of https://github.com/taigrr/nats.docs synced 2025-01-18 04:03:23 -08:00

Update noecho.md

This commit is contained in:
Ginger Collison 2019-10-04 10:34:20 -05:00 committed by GitHub
parent 6ed8d23fa0
commit fd8da6db04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,32 +4,7 @@ By default a NATS connection will echo messages if the connection also has inter
The NoEcho option can be useful in BUS patterns where all applications subscribe and publish to the same subject. Usually a publish represents a state change that the application already knows about, so in the case where the application publishes an update it does not need to process the update itself.
<div class="graphviz"><code data-viz="dot">
digraph {
rankdir=LR;
subgraph cluster_1 {
shape=box;
style="rounded";
label = "Connection #1";
publisher [shape=box, style="rounded", label="Publisher"];
subscriber_1 [shape=box, style="rounded", label="Subscriber"];
}
subgraph cluster_2 {
shape=box;
style="rounded";
label = "Connection #2";
subscriber_2 [shape=box, style="rounded", label="Subscriber"];
}
subject [shape=circle, label="Subject"];
publisher -> subject [label="msg"];
subject -> subscriber_1 [label="echo'd msg", style="dashed"];
subject -> subscriber_2 [label="msg"];
}
</code></div>
![noecho](/assets/images/noecho.svg)
Keep in mind that each connection will have to turn off echo, and that it is per connection, not per application. Also, turning echo on and off can result in a major change to your applications communications protocol since messages will flow or stop flowing based on this setting and the subscribing code won't have any indication as to why.