This commit is contained in:
Justin Bertram 2022-08-19 22:38:42 -05:00
commit fb292fde35
No known key found for this signature in database
GPG Key ID: F41830B875BB8633
2 changed files with 12 additions and 6 deletions

View File

@ -175,11 +175,11 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
private SimpleString expiryAddress = null;
private Long expiryDelay = AddressSettings.DEFAULT_EXPIRY_DELAY;
private Long expiryDelay = null;
private Long minExpiryDelay = AddressSettings.DEFAULT_MIN_EXPIRY_DELAY;
private Long minExpiryDelay = null;
private Long maxExpiryDelay = AddressSettings.DEFAULT_MAX_EXPIRY_DELAY;
private Long maxExpiryDelay = null;
private Boolean defaultLastValueQueue = null;
@ -769,7 +769,7 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
}
public Long getExpiryDelay() {
return expiryDelay;
return expiryDelay != null ? expiryDelay : AddressSettings.DEFAULT_EXPIRY_DELAY;
}
public AddressSettings setExpiryDelay(final Long expiryDelay) {
@ -778,7 +778,7 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
}
public Long getMinExpiryDelay() {
return minExpiryDelay;
return minExpiryDelay != null ? minExpiryDelay : AddressSettings.DEFAULT_MIN_EXPIRY_DELAY;
}
public AddressSettings setMinExpiryDelay(final Long minExpiryDelay) {
@ -787,7 +787,7 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
}
public Long getMaxExpiryDelay() {
return maxExpiryDelay;
return maxExpiryDelay != null ? maxExpiryDelay : AddressSettings.DEFAULT_MAX_EXPIRY_DELAY;
}
public AddressSettings setMaxExpiryDelay(final Long maxExpiryDelay) {

View File

@ -71,6 +71,9 @@ public class AddressSettingsTest extends ActiveMQTestBase {
addressSettingsToMerge.setPageSizeBytes(1004);
addressSettingsToMerge.setMaxSizeBytesRejectThreshold(10 * 1024);
addressSettingsToMerge.setConfigDeleteDiverts(DeletionPolicy.FORCE);
addressSettingsToMerge.setExpiryDelay(999L);
addressSettingsToMerge.setMinExpiryDelay(888L);
addressSettingsToMerge.setMaxExpiryDelay(777L);
addressSettings.merge(addressSettingsToMerge);
Assert.assertEquals(addressSettings.getDeadLetterAddress(), DLQ);
@ -84,6 +87,9 @@ public class AddressSettingsTest extends ActiveMQTestBase {
Assert.assertEquals(AddressFullMessagePolicy.DROP, addressSettings.getAddressFullMessagePolicy());
Assert.assertEquals(addressSettings.getMaxSizeBytesRejectThreshold(), 10 * 1024);
Assert.assertEquals(DeletionPolicy.FORCE, addressSettings.getConfigDeleteDiverts());
Assert.assertEquals(Long.valueOf(999), addressSettings.getExpiryDelay());
Assert.assertEquals(Long.valueOf(888), addressSettings.getMinExpiryDelay());
Assert.assertEquals(Long.valueOf(777), addressSettings.getMaxExpiryDelay());
}
@Test