diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java b/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java index 2cf563734c..26e6987f5f 100755 --- a/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java +++ b/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java @@ -1149,7 +1149,7 @@ public class FailoverTransport implements CompositeTransport { } backups.removeAll(disposedList); disposedList.clear(); - for (Iterator iter = backupList.iterator(); iter.hasNext() && backups.size() < backupPoolSize; ) { + for (Iterator iter = backupList.iterator(); !disposed && iter.hasNext() && backups.size() < backupPoolSize; ) { URI uri = iter.next(); if (connectedTransportURI != null && !connectedTransportURI.equals(uri)) { try {