Hello everybody,
I'd like to know if it is possible to check if an instance of Persistence Service is running in order to be sure that my samples are stored correctly in non-volatile memory.
I'd prefere not to use Remote Administration of the service.
Thank you in advance and best regards
Hello Raz,
I suspect you may benefit from configuring your DataWriter to regard the Persistence Service as a required subscription. Does this look like it might match your use case?
Regards,
Tom
Hi Tom,
thanks for your quick reply.
I don't understand how required subscriptions may solve my problem. What I'm looking for is a way to determine, if a Persistence Service listens to my DataWriter or if no Persistence Service is running at all.
How can I achieve this with required subscriptions?
My first attempt was to use application acknowledgments, but using this code:
leads to the following error / output:
Does anybody know why get_matched_subscription_participant_data fails with error code 4 (DDS_RETCODE_PRECONDITION_NOT_MET) for acknowledgments sent by a Persistence Service?
The call to get_matched_subscription_participant_data is successful for acknowledgments sent by any other DataReader but fails for a connected Persistence Service.
Best regards
Hi Raz,
You can monitor the DataWriter's PublicationMatchedStatus. When a Persistence Service DataReader is discovered you can get its info by invoking DataWriter::get_matched_subscription_data. Within the SubscriptionBuiltinTopicData there is an enumeration field called service. When the value is DDS_PERSISTENCE_SERVICE_QOS you are macthing with a Persistence Service DataReader.
Regards,
- Fernando
Hi Fernando,
thank you very much for your help!
I just implemented your solution and it works like a charm:
Best regards,
raz