Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] Javascript client subscribe and return code

The returned array is only the returned QoS/Error Code (if 3.1.1), it would useful to have topic and returned qos/error in the callback but I don't think that would be an easy change to make atm. The key point is that currently we return an array of results which only ever has 1 element. Personally I am also in favour of extending the client to allow multiple topic subscriptions.

Al

On 11/09/14 09:56, Darren Clark wrote:
Since the spec allow for multiple topics in a subscribe message I would
think that changing the api to allow for multiple topics would be sensible.

Don't have the code in hand, but does the return array also have QoS?
Since that's the response from the broker it would make sense for the
return to be topic/qos pairs. Although if it's currently only an array
or topics that would be breaking. It would however be a simple fix, and
I doubt many implementations actually check the return value.

Darren

On Sep 8, 2014 9:15 AM, "Al Stockdill-Mander" <asm@xxxxxxxx
<mailto:asm@xxxxxxxx>> wrote:

    https://bugs.eclipse.org/bugs/__show_bug.cgi?id=440767
    <https://bugs.eclipse.org/bugs/show_bug.cgi?id=440767>

    This bug has been raised on the Javascript client, in summary
    currently the subscribe function takes a single topic but in the
    callback you are returned an array of responses, this array only
    ever having one element.

    This doesn't really make sense/looks a bit silly. So the question is
    what do we do about it? To change to only return a single value is
    the obvious and easiest solution to implement, but would potentially
    break someone who updated the client without updating their app, and
    being as we've just done a 1.0.0 release perhaps changing the API
    isn't such a good idea.

    Alternatively we could allow subscribe to be passed multiple
    topics/qos, keep the currently returned array and just populate it
    as appropriate depending on the number of topics in the subscribe.

    I'm looking for opinions on the above or any other options for
    resolving this, either here or on the bug.

    Thanks,

    Al
    _________________________________________________
    paho-dev mailing list
    paho-dev@xxxxxxxxxxx <mailto:paho-dev@xxxxxxxxxxx>
    To change your delivery options, retrieve your password, or
    unsubscribe from this list, visit
    https://dev.eclipse.org/__mailman/listinfo/paho-dev
    <https://dev.eclipse.org/mailman/listinfo/paho-dev>



_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/paho-dev



Back to the top