Hi Jeffrey,

On Fri, Nov 14, 2014 at 6:19 AM, Jeffrey Nguyen (jeffrngu) <
jeffr...@cisco.com> wrote:

>  Hi,
>
>  While testing Stratos 4.1 M3, I noticed about half the times,
> unsubscribing a cartridge takes 60+ seconds to execute.  During that time,
> the caller is blocked.  I poke around Stratos code and found TopicPublisher
> class that is responsible for the 60 second retry delay.  The code sleeps
> for 60 seconds whenever we encounter an exception while posting the given
> message to its corresponding topic.   Looks like this code has been around
> since at least release 4.0.0.
>
>  It seems to me 60 sec delay is way to long.  If you have a lot of
> subscriptions, the delay can be multiple factor of 60 seconds.   Also, if
> you do this via Stratos' Rest API, the request might get timed out before
> the response comes back?
>
>  I reduced this delay from 60 seconds to one second and tested and
> noticed that worked just fine.   I'm planning to push this change upstream
> unless I get any objection on that.
>
As Udara mentioned, we can improve this algorithm to start from 1 second
and then increase the time interval that publisher waits before trying to
publish. If the broker/connection is not available for a long time, no
point in keep trying per one second.

>
>  As for why the exception while attempting to update the topic, I did
> some googling and found [1].   It seems this is an issue with mqtt-client.
>   Somehow we're getting a stale connection to MB when we update the topic.
>   We're currently using version 0.4.0 of mqtt-client.  From [2], it looks
> like the latest version is 1.0.0.   Maybe it's time to upgrade?
>
+1

>
>  Other question: when I make a Rest call to get list of subscriptions and
> it returns nothing, is it safe to assume all spawn instances have been
> killed?
>
>  Regards,
> -Jeffrey
>
>  [1] https://github.com/openhab/openhab/issues/980
> *[2] *http://git.eclipse.org/c/paho/org.eclipse.paho.mqtt.java.git/
>
> --
> <http://git.eclipse.org/c/paho/org.eclipse.paho.mqtt.java.git/>
> <http://git.eclipse.org/c/paho/org.eclipse.paho.mqtt.java.git/>
> Thanks and Regards,
>
> Isuru H.
> <http://git.eclipse.org/c/paho/org.eclipse.paho.mqtt.java.git/>
> +94 716 358 048
> <http://git.eclipse.org/c/paho/org.eclipse.paho.mqtt.java.git/>*
> <http://wso2.com/>*
>
>
> * <http://wso2.com/>*
>
>
>

Reply via email to