diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/logs/AuditLogger.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/logs/AuditLogger.java index 94a879cde3..ff9c7804dd 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/logs/AuditLogger.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/logs/AuditLogger.java @@ -2843,4 +2843,12 @@ public interface AuditLogger extends BasicLogger { @LogMessage(level = Logger.Level.INFO) @Message(id = 601747, value = "User {0} is getting auto-created property on target resource: {1} {2}", format = Message.Format.MESSAGE_FORMAT) void isAutoCreated(String user, Object source, Object... args); + + static void getMaxRetryInterval(Object source) { + BASE_LOGGER.getMaxRetryInterval(getCaller(), source); + } + + @LogMessage(level = Logger.Level.INFO) + @Message(id = 601748, value = "User {0} is getting max retry interval on target resource: {1} {2}", format = Message.Format.MESSAGE_FORMAT) + void getMaxRetryInterval(String user, Object source, Object... args); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/BridgeControl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/BridgeControl.java index 9dd7dc87c1..cbe741c9a3 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/BridgeControl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/BridgeControl.java @@ -89,6 +89,12 @@ public interface BridgeControl extends ActiveMQComponentControl { @Attribute(desc = "retry interval multiplier used by this bridge") double getRetryIntervalMultiplier(); + /** + * Returns the max retry interval used by this bridge. + */ + @Attribute(desc = "max retry interval used by this bridge") + long getMaxRetryInterval(); + /** * Returns the number of reconnection attempts used by this bridge. */ diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/BridgeControlImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/BridgeControlImpl.java index b06224630e..c09d5d5d7a 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/BridgeControlImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/BridgeControlImpl.java @@ -171,6 +171,19 @@ public class BridgeControlImpl extends AbstractControl implements BridgeControl } } + @Override + public long getMaxRetryInterval() { + if (AuditLogger.isBaseLoggingEnabled()) { + AuditLogger.getMaxRetryInterval(this.bridge); + } + clearIO(); + try { + return configuration.getMaxRetryInterval(); + } finally { + blockOnIO(); + } + } + @Override public String getTransformerClassName() { if (AuditLogger.isBaseLoggingEnabled()) { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/BridgeControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/BridgeControlTest.java index 7c50984a45..b59fda9ee1 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/BridgeControlTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/BridgeControlTest.java @@ -63,6 +63,7 @@ public class BridgeControlTest extends ManagementTestBase { Assert.assertEquals(bridgeConfig.getFilterString(), bridgeControl.getFilterString()); Assert.assertEquals(bridgeConfig.getRetryInterval(), bridgeControl.getRetryInterval()); Assert.assertEquals(bridgeConfig.getRetryIntervalMultiplier(), bridgeControl.getRetryIntervalMultiplier(), 0.000001); + Assert.assertEquals(bridgeConfig.getMaxRetryInterval(), bridgeControl.getMaxRetryInterval()); Assert.assertEquals(bridgeConfig.getReconnectAttempts(), bridgeControl.getReconnectAttempts()); Assert.assertEquals(bridgeConfig.isUseDuplicateDetection(), bridgeControl.isUseDuplicateDetection()); Map bridgeMetrics = bridgeControl.getMetrics(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/BridgeControlUsingCoreTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/BridgeControlUsingCoreTest.java index 76edbde5f7..7059a558c1 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/BridgeControlUsingCoreTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/BridgeControlUsingCoreTest.java @@ -67,6 +67,7 @@ public class BridgeControlUsingCoreTest extends ManagementTestBase { Assert.assertEquals(bridgeConfig.getFilterString(), proxy.retrieveAttributeValue("filterString")); Assert.assertEquals(bridgeConfig.getRetryInterval(), proxy.retrieveAttributeValue("retryInterval", Long.class)); Assert.assertEquals(bridgeConfig.getRetryIntervalMultiplier(), proxy.retrieveAttributeValue("retryIntervalMultiplier", Double.class)); + Assert.assertEquals(bridgeConfig.getMaxRetryInterval(), proxy.retrieveAttributeValue("maxRetryInterval", Long.class)); Assert.assertEquals(bridgeConfig.getReconnectAttempts(), proxy.retrieveAttributeValue("reconnectAttempts", Integer.class)); Assert.assertEquals(bridgeConfig.isUseDuplicateDetection(), proxy.retrieveAttributeValue("useDuplicateDetection", Boolean.class));