I'm using fastrtps (https://github.com/eProsima/Fast-RTPS) C++ DDS implementation to publish and subscribe data, using it's publish/subscribe layer (not lower level reader/writer layer). Fastrtps supports history, meaning subscriber joining after publisher has published some messages should be able to receive those old messages. Documentation quite clearly explains how to configure the history on both publisher and subscriber side, but there is no documentation on how to read actual history messages. I wasn't able to find any clues from header files either.
How can I receive history messages using fastrtps publish/subscribe layer?
Normal fastrtps::SubscriberListener::onNewDataMessage() callback does not seem to work for history, only for new messages (as it's signature suggests). I would have expected something like this:
fastrtps::Subsciber *mySubscriber;
(...)
mySubscriber->getHistory(...);
or perhaps
MySubscriberListerner : public fastrtps::SubscriberListener
{
(...)
void onHistoryMessage(); // SubscriberListener callback
}
But can't find anything like this.