git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1359880 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Timothy A. Bish 2012-07-10 20:07:27 +00:00
parent fd24ab8036
commit 7308396581
1 changed files with 4 additions and 2 deletions

View File

@ -17,6 +17,7 @@
package org.apache.activemq.network.jms;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.jms.Connection;
import javax.jms.Destination;
import javax.jms.JMSException;
@ -24,6 +25,7 @@ import javax.jms.Message;
import javax.jms.MessageConsumer;
import javax.jms.MessageListener;
import javax.jms.MessageProducer;
import org.apache.activemq.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -96,11 +98,11 @@ public abstract class DestinationBridge implements Service, MessageListener {
int attempt = 0;
final int maxRetries = jmsConnector.getReconnectionPolicy().getMaxSendRetries();
while (started.get() && message != null && ++attempt <= maxRetries) {
while (started.get() && message != null && attempt <= maxRetries) {
try {
if (attempt > 0) {
if (attempt++ > 0) {
try {
Thread.sleep(jmsConnector.getReconnectionPolicy().getNextDelay(attempt));
} catch(InterruptedException e) {