Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 97A0D175F3 for ; Thu, 25 Sep 2014 14:21:19 +0000 (UTC) Received: (qmail 92416 invoked by uid 500); 25 Sep 2014 14:21:19 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 92375 invoked by uid 500); 25 Sep 2014 14:21:19 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 92366 invoked by uid 99); 25 Sep 2014 14:21:19 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Sep 2014 14:21:19 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Sep 2014 14:20:54 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id A33862388868 for ; Thu, 25 Sep 2014 14:20:52 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r923536 - in /websites/production/activemq/content: cache/main.pageCache mqtt.html subscription-recovery-policy.html Date: Thu, 25 Sep 2014 14:20:52 -0000 To: commits@activemq.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140925142052.A33862388868@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: buildbot Date: Thu Sep 25 14:20:52 2014 New Revision: 923536 Log: Production update by buildbot for activemq Modified: websites/production/activemq/content/cache/main.pageCache websites/production/activemq/content/mqtt.html websites/production/activemq/content/subscription-recovery-policy.html Modified: websites/production/activemq/content/cache/main.pageCache ============================================================================== Binary files - no diff available. Modified: websites/production/activemq/content/mqtt.html ============================================================================== --- websites/production/activemq/content/mqtt.html (original) +++ websites/production/activemq/content/mqtt.html Thu Sep 25 14:20:52 2014 @@ -35,6 +35,7 @@ +
  • For more details on using SSL with ActiveMQ see the following article (How do I use SSL).

Working with Destinations with MQTT

MQTT supports hierarchies and wildcards, though the delimiters and characters are different: - Here's the mapping:

function

ActiveMQ

MQTT

separator

.

/

element

*

+

sub tree

>

#

These values are automatically transposed between clients using JMS/NMS/Stomp and clients using MQTTT. For example - a client subscribing to "foo/#/bar" would receive messages published on a JMS Topic of foo.blah.bar.

Message transformations

MQTT messages are transformed into an JMS ByteMessage. Conversely, the body of any JMS Message is converted to a byte buffer to be the payload of an MQTT message.

Keep Alive

When a client connects, it will send a keep-alive dur ation, usually defaulting to 10s. ActiveMQ will honor the keep-alive duration by setting up an Inactivity Monitor that allows a grace period of 1.5 * duration. After that grace period duration elapses a connection could be closed if there is no activity. A broker receiving a PINGREQ and sending PINGRESP is considered activity to keep the connection opened.

If a client sends a keep-alive value of 0, ActiveMQ will not set up an Inactivity Monitor and connections will not be auto-shutdown due to inactivity. This however can lead to potentially leaky connections, so a default keep alive can be set on the server side (by an admin, for example) to not allow inactive connections to hang. This default keep alive would only be used if specified and if the client requests a keep-alive value of 0. The unit for the keep-alive value is milliseconds.

To enable a default, server- side MQTT keep alive:

- -
+ +

Message Prefetch

When MQTT client connects, it locally create JMS-like consumer to the broker. By default this consumer is created with prefetch size of 1 (message prefetching is explained here in more details). Usually, increasing message prefetch size can boost the performance as messages are dispatched to consumers in batches instead of waiting for the individual acknowledges. To increase prefetch size, you can use activeMQSubscriptionPrefetch transport option, like

+ +

Subscription Strategy

ActiveMQ is a JMS broker in its core, so there needs to be some mapping between MQTT subscriptions and JMS semantics. Subscriptions with QoS=0 (At Most Once) are directly mapped to plain JMS non-persistent topics. For reliable messaging, QoS=1 and QoS=2, by default subscriptions are transformed to JMS durable topic subscribers. This behaviour is desired in most scenarios. For some use cases, it is useful to map these subscriptions to virtual topics. Virtual topics provide a better scalability and are generally better solution if you want to use you MQTT subscribers over network of brokers. To change subscription strategy to use virtual topic, use the following settings:

+ +

Retained Messages

If a message has been published with the retain flag set, then the message will be 'remembered' by the topic so that if a new subscription arrives, the last retained message is sent to the subscription. Underneath, the broker uses retained message subscription recovery policy to retain messages with ActiveMQ.Retain property set. During the message conversion, MQTT messages with retain flag become JMS message with the ActiveMQ.Retain property set and retained by the broker.