Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Paho » JS client subscribes multiple topic
icon9.gif  JS client subscribes multiple topic [message #1748330] Tue, 22 November 2016 10:27 Go to next message
yongh yang is currently offline yongh yangFriend
Messages: 2
Registered: November 2016
Junior Member
Hi,
I am searching JS client for MQTT, and I have a question.
Does Paho JS client support subscribing multiple topic?
As jsdoc , the function client.subscribe(filter,subscribeOptions) only subscribe a topic. can I call subscribe function many times to subscribe many topic ?
anybody experience in Paho JS Client ?
Re: JS client subscribes multiple topic [message #1748406 is a reply to message #1748330] Tue, 22 November 2016 19:44 Go to previous messageGo to next message
Benjamin Cabé is currently offline Benjamin CabéFriend
Messages: 201
Registered: July 2009
Location: Toulouse, France
Senior Member

You can call subscribe multiple times indeed, just like in many other client implementations.
Everything will end up being sent to your "onMessageArrived" callback, and thanks to the destinationName of the message, you can figure out what topic it was posted on.


icon14.gif  Re: JS client subscribes multiple topic [message #1748424 is a reply to message #1748406] Wed, 23 November 2016 01:19 Go to previous message
yongh yang is currently offline yongh yangFriend
Messages: 2
Registered: November 2016
Junior Member
Thanks very much!
It's very important for me! There are many different topic path in my project.
Thanks for your suggestion, I will defined 'type' for ervery message to call the right function.
Previous Topic:mqtt architechture
Next Topic:Regarding Rabbitmq with Mqtt Client Connection Failure
Goto Forum:
  


Current Time: Wed Sep 26 09:13:55 GMT 2018

Powered by FUDForum. Page generated in 0.01885 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top