[prev in list] [next in list] [prev in thread] [next in thread] 

List:       activemq-dev
Subject:    Re: Artemis MQTT durable messages and Topics
From:       Justin Bertram <jbertram () apache ! org>
Date:       2017-02-21 17:59:45
Message-ID: 1500895057.36516731.1487699985388.JavaMail.zimbra () redhat ! com
[Download RAW message or body]

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.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic