I copy this picture from "https://www.elastic.co/guide/en/logstash/current/deploying-and-scaling.html", and I can't understand this architecture how to avoid message queue reveiving duplicate data

then, what the difference between this two picture? according to the document, it was said the second one is better.