activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Bertram <jbert...@apache.org>
Subject Re: Artemis MQTT durable messages and Topics
Date Tue, 21 Feb 2017 17:59:45 GMT
FWIW, if a queue isn't marked as durable then it doesn't matter if a message on that is durable
as it will be lost on restart.  Only durable messages on durable queues survive a broker restart.


Justin

----- Original Message -----
From: "fabio72" <fabio.banfi@beta80group.it>
To: dev@activemq.apache.org
Sent: Tuesday, February 21, 2017 4:08:02 AM
Subject: Re: Artemis MQTT durable messages and Topics

hi Justin,
after connecting via jmx we saw that all topics are durable (indipendently
from qos); analyzing the journal (using artemis data print) we can see that
all messages with qos>0 are durable .
We think that this behaviour may depends from following code:

for topics(from MQTTSubscriptionManager.java):


   private Queue createQueueForSubscription(String topic, int qos) throws
Exception {
      String address = MQTTUtil.convertMQTTAddressFilterToCore(topic);
      SimpleString queue = getQueueNameForTopic(address);

      Queue q = session.getServer().locateQueue(queue);
      if (q == null) {
         q = session.getServerSession().createQueue(new
SimpleString(address), queue, managementFilter, false,
MQTTUtil.DURABLE_MESSAGES && qos >= 0);
      }
      return q;
   }
   
   
for queues (from MQTTPublishManager.java)

   // INBOUND
   void handleMessage(int messageId, String topic, int qos, ByteBuf payload,
boolean retain) throws Exception {
      synchronized (lock) {
         ServerMessage serverMessage =
MQTTUtil.createServerMessageFromByteBuf(session, topic, retain, qos,
payload);

         if (qos > 0) {
            serverMessage.setDurable(MQTTUtil.DURABLE_MESSAGES);
         }
   
Is it possible to use durable messages only for retained messages?

Tks
Fabio





--
View this message in context: http://activemq.2283324.n4.nabble.com/Artemis-MQTT-durable-messages-and-Topics-tp4722239p4722274.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

Mime
View raw message