You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2020/06/05 18:47:15 UTC

[GitHub] [activemq-artemis] clebertsuconic commented on a change in pull request #3169: ARTEMIS-2787 - Add ability to disable and enable a queue

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



##########
File path: artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java
##########
@@ -618,6 +618,52 @@ public boolean isPurgeOnNoConsumers() {
       }
    }
 
+   @Override
+   public void disable() throws Exception {
+      if (AuditLogger.isEnabled()) {
+         AuditLogger.disable(queue);
+      }
+      checkStarted();
+
+      clearIO();
+      try {
+         server.getPostOffice().updateQueue(queue.getQueueConfiguration().setEnabled(false));
+      } finally {
+         blockOnIO();
+      }
+   }
+
+   @Override
+   public void enable() throws Exception {
+      if (AuditLogger.isEnabled()) {
+         AuditLogger.enable(queue);
+      }
+      checkStarted();
+
+      clearIO();
+      try {
+         server.getPostOffice().updateQueue(queue.getQueueConfiguration().setEnabled(true));

Review comment:
       nice one... I will run tests and merge it




----------------------------------------------------------------
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:
users@infra.apache.org