Closed metarsit closed 2 years ago
@kyoungho do we have something like this?
@metarsit I think to_cdr_buffer & from_cdr_buffer functions are not available in Connector. Can you tell me more about your use case with these functions?
so.. i have a few tasks running and all are publishing different data structure.. We are not serializing yet, means my XML in my GO application has to reflect 1:1 data structure for everything.
I am hoping that if we have a feature similar where as long as I know the channel name, I can subscribe to it and read the messages in bytes form. I don’t have to deserialize it.
Go Connector does not encode/decode in JSON (reflected in Go struct) if you do not call Get/Set functions. Reflecting in Go struct is one way to set and get DDS data, but you can interact with Get* (e.g. GetInt) functions without having reflected Go struct like the following example.
To avoid the encode/decode overhead between your tasks, you could pass DDS Sample objects as a Go channel and then you can consume and access the objects with reflected Go struct or Get* functions.
If multiple Go routines accesses the same Connector objects (e.g. Samples), they need to be protected from a race condition.
https://github.com/rticommunity/rticonnextdds-connector-go#threading-model
Question:
Currently everything is defined and it is easy to subscribe/publish messages. However, is there a way for us to serialize the message
Desired behavior:
Blob of data (string or bytes) instead of given data structure
https://community.rti.com/howto/dynamicdata-serialization