Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] Question on MqttClient's subscriptions

one thing to bare in mind with durable subscriptions which occur when clean session is set to false:- once a subscription has been made it survives restarts of the client.  The server persists durable subscriptions and ensures that any messages matching the subscription are queued for the client when it is not connected and delivered the next time it connects. With MQTT there is no need for the client to resubscribe when it reconnects as the MQTT server already has it safely stored it.   If the app does subscribe and a matching subscription is in place it will only keep one active.

In most solutions the application encodes the topic or topics that it subscribes to.  In many cases an application will only subscribe to a single topic.

As an aside many MQTT servers provide a mechanism to query what subscriptions are active

Dave

 



From:        "Nicholas O'Leary" <nick.oleary@xxxxxxxxx>
To:        General development discussions for paho project <paho-dev@xxxxxxxxxxx>,
Date:        20/09/2012 20:44
Subject:        Re: [paho-dev] Question on MqttClient's subscriptions
Sent by:        paho-dev-bounces@xxxxxxxxxxx




Hi Sopot,

none of the existing clients (that I know and regularly use) provide
this functionality, so the java client is no different. This was not a
feature purposefully left off the api - it was simply never considered
as necessary.

Your application is doing the subscribing, so it can very easily keep
a list of the topics it has subscribed to.

Of course you can patch your copy for your needs. If you think it is
generally useful you can supply a patch to the paho bugzilla where it
can be evaluated by the paho committers.

Regards,
Nick


On 20 September 2012 20:35, Sopot Çela <sopotcela@xxxxxxxxx> wrote:
> Hi Nick,
>
> Is this by design? If so why? If not, can I patch it?
>
> Thanks,
> Sopot
>
>
> On Thu, Sep 20, 2012 at 9:33 PM, Nicholas O'Leary <nick.oleary@xxxxxxxxx>
> wrote:
>>
>> Hi Sopot,
>>
>> as you have seen, there is no public API in the client to retrieve
>> that information.
>>
>> So, you either need to maintain that list in your application, or you
>> could modify the paho client to expose the list.
>>
>> Regards,
>> Nick
>>
>>
>> On 20 September 2012 20:23, Sopot Çela <sopotcela@xxxxxxxxx> wrote:
>> > Hi Paho devs,
>> >
>> > I have posted a question (the first ever) on the Paho forums
>> >
http://www.eclipse.org/forums/index.php/t/379061/ Since the forum is
>> > there I
>> > would appreciate it if any of the competent members of the paho
>> > community
>> > would monitor it since it is a delicate time to not answer any
>> > questions.
>> >
>> > However I am pasting the question here in case you all disagree.
>> >
>> > I have a MqttClient. How can I have a list of the topics it is
>> > subscribed
>> > to? I see they are stored in a Hashtable but no public API to get them.
>> >
>> > Best,
>> > Sopot
>> >
>> > _______________________________________________
>> > paho-dev mailing list
>> > paho-dev@xxxxxxxxxxx
>> >
http://dev.eclipse.org/mailman/listinfo/paho-dev
>> >
>> _______________________________________________
>> paho-dev mailing list
>> paho-dev@xxxxxxxxxxx
>>
http://dev.eclipse.org/mailman/listinfo/paho-dev
>
>
>
> _______________________________________________
> paho-dev mailing list
> paho-dev@xxxxxxxxxxx
>
http://dev.eclipse.org/mailman/listinfo/paho-dev
>
_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/paho-dev



Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU

Back to the top