Not recieving all new data

4 posts / 0 new
Last post
JC
Offline
Last seen: 1 year 10 months ago
Joined: 02/03/2015
Posts: 16
Not recieving all new data

I have set up an application which subscribes to a topic and prints all recieved messages every few seconds. The problem is that when it wakes up and goes to call the waitset.wait method which correctly returns a data_available_status it calls the reader.take method and only ends up with a sequence length of 1 however between sleeps it should have received multiple messages on that topic. I need to configure it so that I get all received messages on that topic not just what appears to be the most recent one.

I looked at a few examples including the hello world ones and they seem to exhibit the same behavior.

I have attached a example of how its setup.

AttachmentSize
Plain text icon examplecode.txt1.7 KB
rip
rip's picture
Offline
Last seen: 1 day 10 hours ago
Joined: 04/06/2012
Posts: 324

My guess is that the reader's history.kind is KEEP_ALL and the history.depth is 1.

Where does the application get its QoS from:  in code, built-in profiles or USER_QOS_PROFILES.xml?

 

JC
Offline
Last seen: 1 year 10 months ago
Joined: 02/03/2015
Posts: 16

currently getting it from USER_QOS_PROFILES.xml but there are no QoS properties set in it for the readers.

rip
rip's picture
Offline
Last seen: 1 day 10 hours ago
Joined: 04/06/2012
Posts: 324

You should read up on how/where QoS comes from, if you don't set it.

            DataReaderQos drqos = new DataReaderQos();
            reader.get_qos(drqos);
            System.out.println("History: " + drqos.history.toString());

returns

History: HistoryQosPolicy[kind=KEEP_LAST_HISTORY_QOS, depth=1, refilter=NONE_REFILTER_QOS, id=History, policy_name=History]

which is the default history QoS for readers, when not set by the user through any applicable method.