Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Paho » Synchronous receive of topics with wild card(Subscribing to a topic with a wild card and then receiving all the branches synchronously )
Synchronous receive of topics with wild card [message #1709500] Tue, 29 September 2015 00:51 Go to next message
Waho Paho is currently offline Waho PahoFriend
Messages: 2
Registered: September 2015
Junior Member
Hi,
Background
I am currently working on a design to use MQTT embedded C Client in synchronous mode, I absolutely have to use synchronous mode because this is the only way the software can fit into the state machine.

Question
I need to subscribe to a topic level and receive all the topics in that branch using MQTTClient_receive.
For example I need to subscribe to powerStation/#
Where their may have up to a 100 topics within powerStation/. For example powerStation/1 , powerStation/2 , ... powerStation/100. Each # represents a different physical device collecting data.

If I call MQTTClient_receive how can I make sure I get all the subtopics in the powerStation/# . This problems becomes more noticeable when 100 subtopics exist.

The API states MQTTClient_receive will get the latest message but one of the topic is publishing every 4Hz and the other topic is publishing every 6Hz. How can I make sure I receive first topic.
For example powerStation/1 is publishing every 4Hz, while powerStation/2 is publishing every 6Hz.

Do I subscribe and unsubscribe to each specific topic to make sure I get each.

Re: Synchronous receive of topics with wild card [message #1709726 is a reply to message #1709500] Wed, 30 September 2015 14:40 Go to previous messageGo to next message
Ian Craggs is currently offline Ian CraggsFriend
Messages: 83
Registered: March 2013
Member
No, you just subscribe once and you will get all the messages.

If you have retained messages on all 100 topics, you should get 100 messages when you subscribe. Be aware that if you are using Mosquitto as your MQTT server, the default max_queued_messages setting is 100, which means that only 100 messages will be queued for any client, to stop any single client using a lot of resources. You may need to increase this setting.
Re: Synchronous receive of topics with wild card [message #1710134 is a reply to message #1709726] Mon, 05 October 2015 03:02 Go to previous message
Waho Paho is currently offline Waho PahoFriend
Messages: 2
Registered: September 2015
Junior Member
MQTTClient_receive only returns a single message is that correct? So I would need to poll MQTTClient_receive
Previous Topic:Timeout and Keepalive
Next Topic:Post message automatically after connecting
Goto Forum:
  


Current Time: Tue Apr 23 08:16:48 GMT 2024

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

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

Back to the top