nats-server
nats-server copied to clipboard
Double the number of message count and bytes sent for aggrgated streams
We have a simple NATS hub-leafnode cluster setup.
- Hub has a aggregated stream called
orders
which aggregates stream calledorders
from multiple leaf nodes. - Leaf node stream called
orders
created on subjectssilo_x.orders.>
wherex
is replaced with silo id.
Now the issue I have noticed is that, messages pushed to topic orders.>
on leaf nodes are received twice in hub. I curled stats url to check received messages count and bytes. I don't have any standard NATS subscription for orders.>
in hub cluster though.
Is this a expected behavior? we are trying to avoid multiple GBs of data being sent from leaf nodes to hub on our production.
You will need to give them unique subjects to avoid nats publishing the messages into all streams that listen on any one subject.
@ripienaar forgot to mention that as well. I am actually prefixing all silo orders with silo_x.orders.>
. Will fix this in the issue.
@vividvilla Is this still an issue you observe? If so, one bit of missing info, is the orders
stream bound to the orders.>
subject? You noted the leaf node stream is bound to silo_x.orders.>
, but the leaf node is publishing on orders.>
rather than the local leaf subject? If multiple leaf nodes are publishing to a subject that the hub stream would ultimately received, then indeed, it would be ingested by the stream unless you clamp down permissions or have some other strategy.