ARTEMIS-4103 support journal-lock-acquisition-timeout in broker.xml

This commit is contained in:
Justin Bertram 2022-12-01 13:21:40 -06:00
parent 1846f3dad7
commit df81bfa567
7 changed files with 18 additions and 2 deletions

View File

@ -741,6 +741,8 @@ public final class FileConfigurationParser extends XMLConfigurationUtil {
config.setLogJournalWriteRate(getBoolean(e, "log-journal-write-rate", ActiveMQDefaultConfiguration.isDefaultJournalLogWriteRate()));
config.setJournalLockAcquisitionTimeout(getLong(e, "journal-lock-acquisition-timeout", config.getJournalLockAcquisitionTimeout(), Validators.MINUS_ONE_OR_GT_ZERO));
if (e.hasAttribute("wild-card-routing-enabled")) {
config.setWildcardRoutingEnabled(getBoolean(e, "wild-card-routing-enabled", config.isWildcardRoutingEnabled()));
}

View File

@ -109,6 +109,7 @@ public class ConfigurationImplTest extends ActiveMQTestBase {
Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultPagingDir(), conf.getPagingDirectory());
Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultLargeMessagesDir(), conf.getLargeMessagesDirectory());
Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultJournalCompactPercentage(), conf.getJournalCompactPercentage());
Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultJournalLockAcquisitionTimeout(), conf.getJournalLockAcquisitionTimeout());
Assert.assertEquals(ArtemisConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO, conf.getJournalBufferTimeout_AIO());
Assert.assertEquals(ArtemisConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO, conf.getJournalBufferTimeout_NIO());
Assert.assertEquals(ArtemisConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO, conf.getJournalBufferSize_AIO());
@ -257,6 +258,10 @@ public class ConfigurationImplTest extends ActiveMQTestBase {
conf.setJournalCompactPercentage(i);
Assert.assertEquals(i, conf.getJournalCompactPercentage());
l = RandomUtil.randomLong();
conf.setJournalLockAcquisitionTimeout(l);
Assert.assertEquals(l, conf.getJournalLockAcquisitionTimeout());
i = RandomUtil.randomInt();
conf.setJournalBufferSize_AIO(i);
Assert.assertEquals(i, conf.getJournalBufferSize_AIO());

View File

@ -96,6 +96,8 @@ public class DefaultsFileConfigurationTest extends ConfigurationImplTest {
Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultJournalCompactPercentage(), conf.getJournalCompactPercentage());
Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultJournalLockAcquisitionTimeout(), conf.getJournalLockAcquisitionTimeout());
Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultJournalMinFiles(), conf.getJournalMinFiles());
Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultJournalMaxIoAio(), conf.getJournalMaxIO_AIO());

View File

@ -172,6 +172,7 @@ public class FileConfigurationTest extends ConfigurationImplTest {
Assert.assertEquals(100, conf.getJournalMinFiles());
Assert.assertEquals(123, conf.getJournalCompactMinFiles());
Assert.assertEquals(33, conf.getJournalCompactPercentage());
Assert.assertEquals(7654, conf.getJournalLockAcquisitionTimeout());
Assert.assertEquals(true, conf.isGracefulShutdownEnabled());
Assert.assertEquals(12345, conf.getGracefulShutdownTimeout());
Assert.assertEquals(true, conf.isPopulateValidatedUser());

View File

@ -30,7 +30,7 @@
<security-invalidation-interval>5423</security-invalidation-interval>
<authentication-cache-size>333</authentication-cache-size>
<authorization-cache-size>444</authorization-cache-size>
<journal-lock-acquisition-timeout>123</journal-lock-acquisition-timeout>
<journal-lock-acquisition-timeout>7654</journal-lock-acquisition-timeout>
<wild-card-routing-enabled>true</wild-card-routing-enabled>
<management-address>Giraffe</management-address>
<management-notification-address>Whatever</management-notification-address>

View File

@ -31,7 +31,7 @@
<security-invalidation-interval>5423</security-invalidation-interval>
<authentication-cache-size>333</authentication-cache-size>
<authorization-cache-size>444</authorization-cache-size>
<journal-lock-acquisition-timeout>123</journal-lock-acquisition-timeout>
<journal-lock-acquisition-timeout>7654</journal-lock-acquisition-timeout>
<wild-card-routing-enabled>true</wild-card-routing-enabled>
<management-address>Giraffe</management-address>
<management-notification-address>Whatever</management-notification-address>

View File

@ -346,6 +346,12 @@ The message journal is configured using the following attributes in
data files on the journal
The default for this parameter is `30`
- `journal-lock-acquisition-timeout`
How long to wait (in milliseconds) to acquire a file lock on the journal before giving up
The default for this parameter is `-1` (i.e. indefinite))
- `journal-datasync` (default: true)