This commit is contained in:
Clebert Suconic 2020-03-25 16:43:38 -04:00
commit 31e71ba905
13 changed files with 9 additions and 23 deletions

View File

@ -228,6 +228,7 @@ public final class ActiveMQDefaultConfiguration {
private static long DEFAULT_ADDRESS_QUEUE_SCAN_PERIOD = 30000; private static long DEFAULT_ADDRESS_QUEUE_SCAN_PERIOD = 30000;
// the priority of the thread expiring messages // the priority of the thread expiring messages
@Deprecated
private static int DEFAULT_MESSAGE_EXPIRY_THREAD_PRIORITY = 3; private static int DEFAULT_MESSAGE_EXPIRY_THREAD_PRIORITY = 3;
// the size of the cache for pre-creating message ID's // the size of the cache for pre-creating message ID's
@ -817,6 +818,7 @@ public final class ActiveMQDefaultConfiguration {
/** /**
* the priority of the thread expiring messages * the priority of the thread expiring messages
*/ */
@Deprecated
public static int getDefaultMessageExpiryThreadPriority() { public static int getDefaultMessageExpiryThreadPriority() {
return DEFAULT_MESSAGE_EXPIRY_THREAD_PRIORITY; return DEFAULT_MESSAGE_EXPIRY_THREAD_PRIORITY;
} }

View File

@ -366,6 +366,7 @@ public interface ActiveMQServerControl {
* Returns the priority of the thread used to scan message expiration. * Returns the priority of the thread used to scan message expiration.
*/ */
@Attribute(desc = "Priority of the thread used to scan message expiration") @Attribute(desc = "Priority of the thread used to scan message expiration")
@Deprecated
long getMessageExpiryThreadPriority(); long getMessageExpiryThreadPriority();
/** /**

View File

@ -981,11 +981,13 @@ public interface Configuration {
* Returns the priority of the thread used to scan message expiration. <br> * Returns the priority of the thread used to scan message expiration. <br>
* Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_MESSAGE_EXPIRY_THREAD_PRIORITY}. * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_MESSAGE_EXPIRY_THREAD_PRIORITY}.
*/ */
@Deprecated
int getMessageExpiryThreadPriority(); int getMessageExpiryThreadPriority();
/** /**
* Sets the priority of the thread used to scan message expiration. * Sets the priority of the thread used to scan message expiration.
*/ */
@Deprecated
Configuration setMessageExpiryThreadPriority(int messageExpiryThreadPriority); Configuration setMessageExpiryThreadPriority(int messageExpiryThreadPriority);
/** /**

View File

@ -379,8 +379,6 @@ public final class FileConfigurationParser extends XMLConfigurationUtil {
config.setMessageExpiryScanPeriod(getLong(e, "message-expiry-scan-period", config.getMessageExpiryScanPeriod(), Validators.MINUS_ONE_OR_GT_ZERO)); config.setMessageExpiryScanPeriod(getLong(e, "message-expiry-scan-period", config.getMessageExpiryScanPeriod(), Validators.MINUS_ONE_OR_GT_ZERO));
config.setMessageExpiryThreadPriority(getInteger(e, "message-expiry-thread-priority", config.getMessageExpiryThreadPriority(), Validators.THREAD_PRIORITY_RANGE));
config.setAddressQueueScanPeriod(getLong(e, "address-queue-scan-period", config.getAddressQueueScanPeriod(), Validators.MINUS_ONE_OR_GT_ZERO)); config.setAddressQueueScanPeriod(getLong(e, "address-queue-scan-period", config.getAddressQueueScanPeriod(), Validators.MINUS_ONE_OR_GT_ZERO));
config.setIDCacheSize(getInteger(e, "id-cache-size", config.getIDCacheSize(), Validators.GT_ZERO)); config.setIDCacheSize(getInteger(e, "id-cache-size", config.getIDCacheSize(), Validators.GT_ZERO));

View File

@ -3773,6 +3773,7 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
} }
@Override @Override
@Deprecated
public long getMessageExpiryThreadPriority() { public long getMessageExpiryThreadPriority() {
if (AuditLogger.isEnabled()) { if (AuditLogger.isEnabled()) {
AuditLogger.getMessageExpiryThreadPriority(this.server); AuditLogger.getMessageExpiryThreadPriority(this.server);

View File

@ -331,7 +331,7 @@
<xsd:element name="message-expiry-thread-priority" type="xsd:int" default="3" maxOccurs="1" minOccurs="0"> <xsd:element name="message-expiry-thread-priority" type="xsd:int" default="3" maxOccurs="1" minOccurs="0">
<xsd:annotation> <xsd:annotation>
<xsd:documentation> <xsd:documentation>
the priority of the thread expiring messages DEPRECATED: the priority of the thread expiring messages
</xsd:documentation> </xsd:documentation>
</xsd:annotation> </xsd:annotation>
</xsd:element> </xsd:element>

View File

@ -57,7 +57,6 @@ public class ConfigurationImplTest extends ActiveMQTestBase {
Assert.assertEquals(ActiveMQDefaultConfiguration.isDefaultWildcardRoutingEnabled(), conf.isWildcardRoutingEnabled()); Assert.assertEquals(ActiveMQDefaultConfiguration.isDefaultWildcardRoutingEnabled(), conf.isWildcardRoutingEnabled());
Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultTransactionTimeout(), conf.getTransactionTimeout()); Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultTransactionTimeout(), conf.getTransactionTimeout());
Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultMessageExpiryScanPeriod(), conf.getMessageExpiryScanPeriod()); // OK Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultMessageExpiryScanPeriod(), conf.getMessageExpiryScanPeriod()); // OK
Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultMessageExpiryThreadPriority(), conf.getMessageExpiryThreadPriority()); // OK
Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultTransactionTimeoutScanPeriod(), conf.getTransactionTimeoutScanPeriod()); // OK Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultTransactionTimeoutScanPeriod(), conf.getTransactionTimeoutScanPeriod()); // OK
Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultManagementAddress(), conf.getManagementAddress()); // OK Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultManagementAddress(), conf.getManagementAddress()); // OK
Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultManagementNotificationAddress(), conf.getManagementNotificationAddress()); // OK Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultManagementNotificationAddress(), conf.getManagementNotificationAddress()); // OK
@ -163,10 +162,6 @@ public class ConfigurationImplTest extends ActiveMQTestBase {
conf.setManagementAddress(new SimpleString(s)); conf.setManagementAddress(new SimpleString(s));
Assert.assertEquals(s, conf.getManagementAddress().toString()); Assert.assertEquals(s, conf.getManagementAddress().toString());
i = RandomUtil.randomInt();
conf.setMessageExpiryThreadPriority(i);
Assert.assertEquals(i, conf.getMessageExpiryThreadPriority());
l = RandomUtil.randomLong(); l = RandomUtil.randomLong();
conf.setMessageExpiryScanPeriod(l); conf.setMessageExpiryScanPeriod(l);
Assert.assertEquals(l, conf.getMessageExpiryScanPeriod()); Assert.assertEquals(l, conf.getMessageExpiryScanPeriod());
@ -365,10 +360,6 @@ public class ConfigurationImplTest extends ActiveMQTestBase {
conf.setManagementAddress(new SimpleString(s)); conf.setManagementAddress(new SimpleString(s));
Assert.assertEquals(s, conf.getManagementAddress().toString()); Assert.assertEquals(s, conf.getManagementAddress().toString());
i = RandomUtil.randomInt();
conf.setMessageExpiryThreadPriority(i);
Assert.assertEquals(i, conf.getMessageExpiryThreadPriority());
l = RandomUtil.randomLong(); l = RandomUtil.randomLong();
conf.setMessageExpiryScanPeriod(l); conf.setMessageExpiryScanPeriod(l);
Assert.assertEquals(l, conf.getMessageExpiryScanPeriod()); Assert.assertEquals(l, conf.getMessageExpiryScanPeriod());

View File

@ -128,8 +128,6 @@ public class DefaultsFileConfigurationTest extends ConfigurationImplTest {
Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultAddressQueueScanPeriod(), conf.getAddressQueueScanPeriod()); Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultAddressQueueScanPeriod(), conf.getAddressQueueScanPeriod());
Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultMessageExpiryThreadPriority(), conf.getMessageExpiryThreadPriority());
Assert.assertTrue(conf.getHAPolicyConfiguration() instanceof LiveOnlyPolicyConfiguration); Assert.assertTrue(conf.getHAPolicyConfiguration() instanceof LiveOnlyPolicyConfiguration);
Assert.assertEquals(ActiveMQDefaultConfiguration.isDefaultGracefulShutdownEnabled(), conf.isGracefulShutdownEnabled()); Assert.assertEquals(ActiveMQDefaultConfiguration.isDefaultGracefulShutdownEnabled(), conf.isGracefulShutdownEnabled());

View File

@ -114,7 +114,6 @@ public class FileConfigurationTest extends ConfigurationImplTest {
Assert.assertEquals(98765, conf.getTransactionTimeout()); Assert.assertEquals(98765, conf.getTransactionTimeout());
Assert.assertEquals(56789, conf.getTransactionTimeoutScanPeriod()); Assert.assertEquals(56789, conf.getTransactionTimeoutScanPeriod());
Assert.assertEquals(10111213, conf.getMessageExpiryScanPeriod()); Assert.assertEquals(10111213, conf.getMessageExpiryScanPeriod());
Assert.assertEquals(8, conf.getMessageExpiryThreadPriority());
Assert.assertEquals(25000, conf.getAddressQueueScanPeriod()); Assert.assertEquals(25000, conf.getAddressQueueScanPeriod());
Assert.assertEquals(127, conf.getIDCacheSize()); Assert.assertEquals(127, conf.getIDCacheSize());
Assert.assertEquals(true, conf.isPersistIDCache()); Assert.assertEquals(true, conf.isPersistIDCache());

View File

@ -331,7 +331,7 @@
<xsd:element name="message-expiry-thread-priority" type="xsd:int" default="3" maxOccurs="1" minOccurs="0"> <xsd:element name="message-expiry-thread-priority" type="xsd:int" default="3" maxOccurs="1" minOccurs="0">
<xsd:annotation> <xsd:annotation>
<xsd:documentation> <xsd:documentation>
the priority of the thread expiring messages DEPRECATED: the priority of the thread expiring messages
</xsd:documentation> </xsd:documentation>
</xsd:annotation> </xsd:annotation>
</xsd:element> </xsd:element>

View File

@ -153,7 +153,7 @@ log-delegate-factory-class-name | **deprecated** the name of the factory class t
[message-counter-max-day-history](management.md#message-counters)| how many days to keep message counter history. | 10 [message-counter-max-day-history](management.md#message-counters)| how many days to keep message counter history. | 10
[message-counter-sample-period](management.md#message-counters) | the sample period (in ms) to use for message counters. | 10000 [message-counter-sample-period](management.md#message-counters) | the sample period (in ms) to use for message counters. | 10000
[message-expiry-scan-period](message-expiry.md#configuring-the-expiry-reaper-thread) | how often (in ms) to scan for expired messages. | 30000 [message-expiry-scan-period](message-expiry.md#configuring-the-expiry-reaper-thread) | how often (in ms) to scan for expired messages. | 30000
[message-expiry-thread-priority](message-expiry.md#configuring-the-expiry-reaper-thread)| the priority of the thread expiring messages. | 3 [message-expiry-thread-priority](message-expiry.md#configuring-the-expiry-reaper-thread)| **deprecated** the priority of the thread expiring messages. | 3
[metrics-plugin](metrics.md) | [a plugin to export metrics](#metrics-plugin-type) | n/a [metrics-plugin](metrics.md) | [a plugin to export metrics](#metrics-plugin-type) | n/a
[address-queue-scan-period](address-model.md#configuring-addresses-and-queues-via-address-settings) | how often (in ms) to scan for addresses & queues that should be removed. | 30000 [address-queue-scan-period](address-model.md#configuring-addresses-and-queues-via-address-settings) | how often (in ms) to scan for addresses & queues that should be removed. | 30000
name | node name; used in topology notifications if set. | n/a name | node name; used in topology notifications if set. | n/a

View File

@ -146,11 +146,6 @@ The reaper thread can be configured with the following properties in
How often the queues will be scanned to detect expired messages (in How often the queues will be scanned to detect expired messages (in
milliseconds, default is 30000ms, set to `-1` to disable the reaper thread) milliseconds, default is 30000ms, set to `-1` to disable the reaper thread)
- `message-expiry-thread-priority`
The reaper thread priority (it must be between 1 and 10, 10 being the highest
priority, default is 3)
## Example ## Example
See the [Message Expiration Example](examples.md#message-expiration) which See the [Message Expiration Example](examples.md#message-expiration) which

View File

@ -166,7 +166,6 @@ public class ActiveMQServerControlTest extends ManagementTestBase {
Assert.assertEquals(conf.isMessageCounterEnabled(), serverControl.isMessageCounterEnabled()); Assert.assertEquals(conf.isMessageCounterEnabled(), serverControl.isMessageCounterEnabled());
Assert.assertEquals(conf.getTransactionTimeoutScanPeriod(), serverControl.getTransactionTimeoutScanPeriod()); Assert.assertEquals(conf.getTransactionTimeoutScanPeriod(), serverControl.getTransactionTimeoutScanPeriod());
Assert.assertEquals(conf.getMessageExpiryScanPeriod(), serverControl.getMessageExpiryScanPeriod()); Assert.assertEquals(conf.getMessageExpiryScanPeriod(), serverControl.getMessageExpiryScanPeriod());
Assert.assertEquals(conf.getMessageExpiryThreadPriority(), serverControl.getMessageExpiryThreadPriority());
Assert.assertEquals(conf.getJournalCompactMinFiles(), serverControl.getJournalCompactMinFiles()); Assert.assertEquals(conf.getJournalCompactMinFiles(), serverControl.getJournalCompactMinFiles());
Assert.assertEquals(conf.getJournalCompactPercentage(), serverControl.getJournalCompactPercentage()); Assert.assertEquals(conf.getJournalCompactPercentage(), serverControl.getJournalCompactPercentage());
Assert.assertEquals(conf.isPersistenceEnabled(), serverControl.isPersistenceEnabled()); Assert.assertEquals(conf.isPersistenceEnabled(), serverControl.isPersistenceEnabled());