default message handling [closed]

asked 2014-04-03 10:03:41 -0600

Mago Nick gravatar image

updated 2022-03-20 10:18:00 -0600

lucasw gravatar image

Hello everybody, I would like to know if there is a way to handle default values messages. Here is the situation. I have a subscriber and a publisher both written in c++ that read and write at different speeds. The publisher is very slow with respect to the subscriber. Since the subscriber if very fast happens often that the topic is empty. This causes the retrieval of continuous default messages that are very ambiguous (the string is default set to "0" and this is actually a problem) is there a way to check if the topic is empty and throw away the message? thanks Andrea

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Mago Nick
close date 2014-04-04 00:54:37


I'm not sure if I follow. If there is no message on the topic, your subscriber will not receive an empty one, not matter how "fast" it is. Maybe show some code to illustrate what you are doing.

demmeln gravatar image demmeln  ( 2014-04-03 14:44:03 -0600 )edit

If there is no message on a topic the subscriber gets a default value of the type of message it is looking for. I am adding some code in the question

Mago Nick gravatar image Mago Nick  ( 2014-04-03 21:24:09 -0600 )edit

@demmein yes you were right. It was a side effect of some other code. Sorry for the silly question ;)

Mago Nick gravatar image Mago Nick  ( 2014-04-03 21:28:10 -0600 )edit

If your problem is solved please mark your question as closed or something similar!

BennyRe gravatar image BennyRe  ( 2014-04-04 00:35:42 -0600 )edit

Yes, I forgot. Thanks for reminding

Mago Nick gravatar image Mago Nick  ( 2014-04-04 00:54:15 -0600 )edit