clebertsuconic commented on code in PR #5715:
URL: https://github.com/apache/activemq-artemis/pull/5715#discussion_r2114404769


##########
artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTStateManager.java:
##########
@@ -172,25 +175,13 @@ public String toString() {
       return "MQTTSessionStateManager@" + 
Integer.toHexString(System.identityHashCode(this));
    }
 
-   public void storeSessionState(MQTTSessionState state) throws Exception {
-      logger.debug("Adding durable MQTT state record for: {}", 
state.getClientId());
-
-      /*
-       * It is imperative to ensure the routed message is actually *all the 
way* on the queue before proceeding
-       * otherwise there can be a race with removing it.
-       */
-      CountDownLatch latch = new CountDownLatch(1);
-      Transaction tx = new TransactionImpl(server.getStorageManager());
-      server.getPostOffice().route(serializeState(state, 
server.getStorageManager().generateID()), tx, false);
-      tx.addOperation(new TransactionOperationAbstract() {
-         @Override
-         public void afterCommit(Transaction tx) {
-            latch.countDown();
-         }
-      });
-      tx.commit();
-      if (!latch.await(timeout, TimeUnit.MILLISECONDS)) {
-         throw MQTTBundle.BUNDLE.unableToStoreMqttState(timeout);
+   public void storeDurableSubscriptionState(MQTTSessionState state) throws 
Exception {
+      if (subscriptionPersistenceEnabled) {

Review Comment:
   @jbertram since you added this property now. .you need to add a cleanup.
   
   honestly I wouldn't make the change as it's bigger than you realized.
   
   Unless you clearly document that such states would leak between changing the 
property from true -> false in any case (hot deploy or restart).
   
   
   I would leave this feature out now though.



-- 
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.

To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org
For additional commands, e-mail: gitbox-h...@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact


Reply via email to