clebertsuconic commented on a change in pull request #3580:
URL: https://github.com/apache/activemq-artemis/pull/3580#discussion_r632893752



##########
File path: 
artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java
##########
@@ -768,6 +772,45 @@ public void parseMainConfig(final Element e, final 
Configuration config) throws
       }
    }
 
+
+   private void parseJournalRetention(final Element e, final Configuration 
config) {
+      NodeList retention = e.getElementsByTagName("journal-retention");
+
+      if (retention.getLength() != 0) {
+         Element node = (Element) retention.item(0);
+
+         String directory = getAttributeValue(node, "directory");
+         long storageLimit = ByteUtil.convertTextBytes(getAttributeValue(node, 
"storage-limit").trim());
+         int period = getAttributeInteger(node, "period", 0, 
Validators.GT_ZERO);
+         String unitStr = getAttributeValue(node, "unit");
+
+         TimeUnit unit;
+
+         switch (unitStr) {
+            case "DAYS":
+               unit = TimeUnit.DAYS;
+               break;
+            case "HOURS":
+               unit = TimeUnit.HOURS;
+               break;
+            case "MINUTES":
+               unit = TimeUnit.MINUTES;
+               break;
+            case "SECONDS":
+               unit = TimeUnit.SECONDS;
+               break;
+            default:
+               unit = TimeUnit.DAYS;
+         }
+
+         config.setJournalRetentionDirectory(directory);
+         config.setJournalRetentionTimeUnit(unit);

Review comment:
       I will think about this between tomorrow (Saturday) and Monday.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to