Java Serialization of DynamicData to XML

3 posts / 0 new
Last post
Offline
Last seen: 2 years 5 months ago
Joined: 04/18/2022
Posts: 8
Java Serialization of DynamicData to XML

Hi Everyone,

I'm extremely new to RTI DDS and have a very limited requirement in scope for a Java application. I want to be able to generically subscribe to all Topics, consume all topic messages and persist them as XML and in Binary.

I have looked through the forum and have made quite a lot of progress following the MonitorData example which subscribes to all the topics on the DCPSPublication topic. I am now recieving the messages as DynamicData in my listener. I have a few issues that I am struggling with here

  • I hear that the "Modern" C++ API has the option to print() thre DynamicData object as XML, but I am unable to find this in the Java API. If it is not possible can someone offer how the C++ API uses the get_ methods to iterate the fields in order to produce the various levels of nested XML?

  • When observing topics/types on the DCPSPublication topic with PublicationBuiltinTopicDataDataReader. Some of the PublicationBuiltinTopicData objects sampled have a null type_code. These are custom types injected by thord parties in our environment with known IDLs. What is going on here. Are the thrird parties not including something when they register the topic/type? Am I missing something in how I can parse the structure? I

  • I would like to serialise the messages to binary and then possibly replay them in sequence at a later date. Am I correct in thinking that the to_cdr_buffer() and from_cdr_buffer() methods are the way to go here?

Thanks greatly in advance for any advice or direction

Cheers

Al

Organization:
Howard's picture
Offline
Last seen: 3 days 8 hours ago
Joined: 11/29/2012
Posts: 608
Offline
Last seen: 2 years 5 months ago
Joined: 04/18/2022
Posts: 8

Thanks Howard,

Not sure how I missed it. I think the majority of discussion in here seemed to suggest that it was only available in the C++ API. 

Al