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.

Reply via email to