tabish121 commented on code in PR #5715:
URL: https://github.com/apache/activemq-artemis/pull/5715#discussion_r2114501094
##########
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:
I think it'd be fine to keep it in if it isn't able to be updated at
runtime, only when you allow runtime updates do you need to start ensuring that
things get cleaned up consistent with the current operating state.
--
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