-
Notifications
You must be signed in to change notification settings - Fork 577
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add optional retry logic to topology recovery
There's no topology recovery retry by default. The default implementation is composable: not all have the recoverable entities have to retry and the retry operations don't have to be only the corresponding entity recovery, but also other operations, like recovering the corresponding channel. Fixes #387 (cherry picked from commit 34e33ea) Conflicts: src/main/java/com/rabbitmq/client/ConnectionFactory.java src/main/java/com/rabbitmq/client/impl/ConnectionParams.java src/main/java/com/rabbitmq/client/impl/recovery/AutorecoveringConnection.java src/test/java/com/rabbitmq/client/test/TestUtils.java src/test/java/com/rabbitmq/client/test/functional/TopologyRecoveryFiltering.java
- Loading branch information
1 parent
77b9747
commit 9e02adb
Showing
18 changed files
with
1,412 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/main/java/com/rabbitmq/client/impl/recovery/BackoffPolicy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright (c) 2018 Pivotal Software, Inc. All rights reserved. | ||
// | ||
// This software, the RabbitMQ Java client library, is triple-licensed under the | ||
// Mozilla Public License 1.1 ("MPL"), the GNU General Public License version 2 | ||
// ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see | ||
// LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL, | ||
// please see LICENSE-APACHE2. | ||
// | ||
// This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, | ||
// either express or implied. See the LICENSE file for specific language governing | ||
// rights and limitations of this software. | ||
// | ||
// If you have any questions regarding licensing, please contact us at | ||
// info@rabbitmq.com. | ||
|
||
package com.rabbitmq.client.impl.recovery; | ||
|
||
/** | ||
* Backoff policy for topology recovery retry attempts. | ||
* | ||
* @see DefaultRetryHandler | ||
* @see TopologyRecoveryRetryHandlerBuilder | ||
* @since 4.8.0 | ||
*/ | ||
public interface BackoffPolicy { | ||
|
||
/** | ||
* Wait depending on the current attempt number (1, 2, 3, etc) | ||
* @param attemptNumber current attempt number | ||
* @throws InterruptedException | ||
*/ | ||
void backoff(int attemptNumber) throws InterruptedException; | ||
} |
Oops, something went wrong.