Asynchronous DataWriters - best practices

2 posts / 0 new
Last post
njc
Offline
Last seen: 5 years 4 months ago
Joined: 08/09/2012
Posts: 17
Asynchronous DataWriters - best practices

We have a number of different data sources that publish data over DDS, using different IDLs. Some messages' max sizes are small, less than 1KB, and some can be quite large over 1MB. Because of the large messages, some data writers are configured to use the Asynchronous PUBLISH_MODE QoS policy.

Is there any way to programmatically determine which writers would need asynchronous publishing? Right now we basically try sending the largest sample possible given the IDL and if it fails publishing (over UDP), then we set that type to use asynchronous publishing.I guess what I'm wonder is if there is anyway way to get the equivalent boolean check of:

If (FooTypeSupport::MaxSize() > UDPTransport::MaxSize())  { set async publshing }

through the API? Or short of that, what do people do in practice so that they don't have to hard-code the decision to use asynchronous publishing or not for each new IDL type. Admittedly, we haven't yet checked the performance of just changing all publishers to use asynchronous publishing, so maybe that is the answer.


Thanks

Offline
Last seen: 5 months 4 weeks ago
Joined: 06/13/2013
Posts: 14

The type support has functions which return the maximum and minimum serialized sample size. For example in C++ you will find the following function in <name>Plugin.cxx file:

<type>Plugin_get_serialized_sample_max_size

<type>Plugin_get_serialized_sample_min_size

 Based on this and maximum transport size you can decide how to set the QoS. It is important that you set the QoS before you enable the publisher since the asynchronous publisher QoS cannot be changed once the publisher is enabled.