diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/RecoverMessages.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/RecoverMessages.java index f6f59c270f..dff9811d73 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/RecoverMessages.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/RecoverMessages.java @@ -68,7 +68,7 @@ public class RecoverMessages extends DBOption { recover(configuration, getJournal(), journalOutput, new File(getLargeMessages()), reclaimed); } } catch (Exception e) { - treatError(e, "data", "print"); + treatError(e, "data", "recover"); } return null; } diff --git a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml index 755087948e..83468fcbf5 100644 --- a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml +++ b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml @@ -53,7 +53,7 @@ ${jdbc} it is recommended to use a separate storage unit from the journal for performance considerations. - data/retention> + data/retention --> ${fsync} diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java index f040fcaa7b..29853d6f36 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java @@ -589,6 +589,7 @@ public interface ActiveMQServerControl { @Parameter(name = "durable", desc = "Is the queue durable?") boolean durable, @Parameter(name = "routingType", desc = "The routing type used for this address, MULTICAST or ANYCAST") String routingType) throws Exception; + /** * Create a queue. *
diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalImpl.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalImpl.java index ed6f38a2a4..651f4573df 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalImpl.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalImpl.java @@ -2550,7 +2550,7 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal public String getHistoryFileName(long sequence, Calendar calendar) { String fileName = String.format("%s-%04d%02d%02d%02d%02d%02d-%d.%s", filesRepository.getFilePrefix(), calendar.get(Calendar.YEAR), - calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH), calendar.get(Calendar.HOUR_OF_DAY), + (calendar.get(Calendar.MONTH) + 1), calendar.get(Calendar.DAY_OF_MONTH), calendar.get(Calendar.HOUR_OF_DAY), calendar.get(Calendar.MINUTE), calendar.get(Calendar.SECOND), sequence, filesRepository.getFileExtension()); return fileName; @@ -2576,10 +2576,11 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal int minutes = Integer.parseInt(datePortion.substring(10, 12)); int seconds = Integer.parseInt(datePortion.substring(12, 14)); - calendar.set(year, month, day, hour, minutes, seconds); + calendar.clear(); + calendar.set(year, month - 1, day, hour, minutes, seconds); return calendar.getTimeInMillis(); - } + public String getDatePortion(String name) { return name.substring(filesRepository.getFilePrefix().length() + 1, name.indexOf("-", filesRepository.getFilePrefix().length() + 1)); } diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournaHistorylBackupTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournaHistorylBackupTest.java index 9c94ba7a83..dda55c286e 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournaHistorylBackupTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournaHistorylBackupTest.java @@ -84,7 +84,7 @@ public class JournaHistorylBackupTest extends ActiveMQTestBase { @Test public void verifyFileName() throws Throwable { - GregorianCalendar clebertsBirthday = new GregorianCalendar(1972, 1, 19, 4, 5, 7); + GregorianCalendar clebertsBirthday = new GregorianCalendar(1972, 0, 19, 4, 5, 7); JournalImpl journal = new JournalImpl(10 * 1024, 10, 10, 0, 100, new FakeSequentialFileFactory(), "cleberts", "birthday", 1); @@ -100,7 +100,7 @@ public class JournaHistorylBackupTest extends ActiveMQTestBase { compareCalendar.setTimeInMillis(d); Assert.assertEquals(1972, compareCalendar.get(Calendar.YEAR)); - Assert.assertEquals(1, compareCalendar.get(Calendar.MONTH)); + Assert.assertEquals(0, compareCalendar.get(Calendar.MONTH)); Assert.assertEquals(19, compareCalendar.get(Calendar.DAY_OF_MONTH)); Assert.assertEquals(4, compareCalendar.get(Calendar.HOUR_OF_DAY)); Assert.assertEquals(5, compareCalendar.get(Calendar.MINUTE));