clebertsuconic commented on code in PR #5715:
URL: https://github.com/apache/activemq-artemis/pull/5715#discussion_r2114287353
##########
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:
@tabish121 what would be the outcome now if you enabled / disabled during a
restart.. would those be cleaned up?
I thought it would keep the same semantics... that is.. if you enable it...
future destinations would start being persisted..
if you disabled.. future destinations wouldn't be persisted
I don't remember of any cleanup code in the broker now ... so it would keep
the same behavior it does now I think.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact