Description
If the broker is closed when a consumer has unacknowledged messages, then these unacknowledged messages may get delivered to other competing consumers before those consumers are themselves closed.
Closing the broker causes it to iterate over all open connections and close each connection in turn. Before closing the connections it should mark them such that they do not attempt any more deliveries.