mirror of https://github.com/apache/activemq.git
AMQ-5949 Treat maxSendRetries of -1 as infinite.
This commit is contained in:
parent
5b2aec5472
commit
505916b927
|
@ -82,6 +82,7 @@ public abstract class DestinationBridge implements Service, MessageListener {
|
|||
return jmsConnector.createReplyToBridge(destination, getConnnectionForConsumer(), getConnectionForProducer());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start() throws Exception {
|
||||
if (started.compareAndSet(false, true)) {
|
||||
createConsumer();
|
||||
|
@ -89,16 +90,18 @@ public abstract class DestinationBridge implements Service, MessageListener {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop() throws Exception {
|
||||
started.set(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMessage(Message message) {
|
||||
|
||||
int attempt = 0;
|
||||
final int maxRetries = jmsConnector.getReconnectionPolicy().getMaxSendRetries();
|
||||
|
||||
while (started.get() && message != null && attempt <= maxRetries) {
|
||||
while (started.get() && message != null && (maxRetries == ReconnectionPolicy.INFINITE || attempt <= maxRetries)) {
|
||||
|
||||
try {
|
||||
|
||||
|
|
Loading…
Reference in New Issue