This closes #4182
This commit is contained in:
commit
fb292fde35
|
@ -175,11 +175,11 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
|
||||||
|
|
||||||
private SimpleString expiryAddress = null;
|
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;
|
private Boolean defaultLastValueQueue = null;
|
||||||
|
|
||||||
|
@ -769,7 +769,7 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getExpiryDelay() {
|
public Long getExpiryDelay() {
|
||||||
return expiryDelay;
|
return expiryDelay != null ? expiryDelay : AddressSettings.DEFAULT_EXPIRY_DELAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AddressSettings setExpiryDelay(final Long expiryDelay) {
|
public AddressSettings setExpiryDelay(final Long expiryDelay) {
|
||||||
|
@ -778,7 +778,7 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getMinExpiryDelay() {
|
public Long getMinExpiryDelay() {
|
||||||
return minExpiryDelay;
|
return minExpiryDelay != null ? minExpiryDelay : AddressSettings.DEFAULT_MIN_EXPIRY_DELAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AddressSettings setMinExpiryDelay(final Long minExpiryDelay) {
|
public AddressSettings setMinExpiryDelay(final Long minExpiryDelay) {
|
||||||
|
@ -787,7 +787,7 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getMaxExpiryDelay() {
|
public Long getMaxExpiryDelay() {
|
||||||
return maxExpiryDelay;
|
return maxExpiryDelay != null ? maxExpiryDelay : AddressSettings.DEFAULT_MAX_EXPIRY_DELAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AddressSettings setMaxExpiryDelay(final Long maxExpiryDelay) {
|
public AddressSettings setMaxExpiryDelay(final Long maxExpiryDelay) {
|
||||||
|
|
|
@ -71,6 +71,9 @@ public class AddressSettingsTest extends ActiveMQTestBase {
|
||||||
addressSettingsToMerge.setPageSizeBytes(1004);
|
addressSettingsToMerge.setPageSizeBytes(1004);
|
||||||
addressSettingsToMerge.setMaxSizeBytesRejectThreshold(10 * 1024);
|
addressSettingsToMerge.setMaxSizeBytesRejectThreshold(10 * 1024);
|
||||||
addressSettingsToMerge.setConfigDeleteDiverts(DeletionPolicy.FORCE);
|
addressSettingsToMerge.setConfigDeleteDiverts(DeletionPolicy.FORCE);
|
||||||
|
addressSettingsToMerge.setExpiryDelay(999L);
|
||||||
|
addressSettingsToMerge.setMinExpiryDelay(888L);
|
||||||
|
addressSettingsToMerge.setMaxExpiryDelay(777L);
|
||||||
|
|
||||||
addressSettings.merge(addressSettingsToMerge);
|
addressSettings.merge(addressSettingsToMerge);
|
||||||
Assert.assertEquals(addressSettings.getDeadLetterAddress(), DLQ);
|
Assert.assertEquals(addressSettings.getDeadLetterAddress(), DLQ);
|
||||||
|
@ -84,6 +87,9 @@ public class AddressSettingsTest extends ActiveMQTestBase {
|
||||||
Assert.assertEquals(AddressFullMessagePolicy.DROP, addressSettings.getAddressFullMessagePolicy());
|
Assert.assertEquals(AddressFullMessagePolicy.DROP, addressSettings.getAddressFullMessagePolicy());
|
||||||
Assert.assertEquals(addressSettings.getMaxSizeBytesRejectThreshold(), 10 * 1024);
|
Assert.assertEquals(addressSettings.getMaxSizeBytesRejectThreshold(), 10 * 1024);
|
||||||
Assert.assertEquals(DeletionPolicy.FORCE, addressSettings.getConfigDeleteDiverts());
|
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
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue