Why an unbounded sequence defined in XML results in a sequence with a default size
Note: The following information applies to RTI Connext DDS 5.3.1 and below.
If a type defined in XML has its sequences or strings set to -1 in the attributes sequenceMaxLength or stringMaxLength, the resulting sequence or string length is interpreted as being of a default size, i.e., 100, rather than unbounded. This issue occurs when working with XML-Based Application Creation in particular, and Dynamic Data-based applications in general.
To solve this issue, you need to set sequenceMaxLength or stringMaxLength to the maximum value of a 32-bit signed integer, i.e., 2^31 -1. This is the length set in the generated code when using RTI Code Generator with the option -unboundedSupport. Using this workaround doesn’t mean that your application will allocate memory for this number of elements. Internally, it will allocate memory based on the actual number of elements in the sequence.
This issue has been fixed in RTI Connext DDS 6.0.0.