Failure to create data reader "get max serialized sample size"

4 posts / 0 new
Last post
Offline
Last seen: 2 years 10 months ago
Joined: 04/24/2020
Posts: 9
Failure to create data reader "get max serialized sample size"

Hi,

 

I am working on an existing system with multiple topics / readers / writers. It is multi-vendor, so the QoS files are shared. I have created a reader of a topic in C# and was able to create all my reader objects and receive data.I am now moving this functionality into a java project. In the java project, when I create the data reader I get a null back and the RTI detail logs say (xxx and yyy removed):

DDS_DomainParticipant_create_subscriber_disabledI:created subscriber
DDS_Subscriber_enable:enabled
DDS_DomainParticipant_create_topic_disabledI:created topic: topic=xxx, type=yyy
DDS_Topic_enable:enabled
DDS_Subscriber_create_datareader_disabledI:created reader: topic=xxx
TypeSupportNativePeer_on_endpoint_attached:!get max serialized sample size
PRESPsService_enableLocalEndpointWithCursor:failed to attach endpoint to typePlugin
PRESPsService_enableLocalEndpoint:!enable local endpoint
[D0102|Sub(80000009)|T=xxx|DELETE Reader]DDS_Subscriber_delete_datareader:deleted reader: topic=xxx

 

This topic IDL contains two strings. One is large (~900kb). In the IDL it is defined as "string<2147483647> zzz". I have read through a lot of RTI forum topics on long strings but am not sure where to start as:

- My C# project worked with no cutom code or QoS file changes

- At least one other vendor is reading this topic - they are C# based

 

I tried setting subscriber.set_default_datareader_qos with "default QoS + property "dds.builtin_type.string.alloc_size" increased to a large value. This did not work. I have read that setting it to unbound may work -

https://community.rti.com/static/documentation/connext-dds/5.2.3/doc/manuals/connext_dds/html_files/RTI_ConnextDDS_CoreLibraries_UsersManual/Content/UsersManual/Managing_Memory_for_Built_in_Types.htm

 

That will be my next attempt. Posting the question as I assumed "if it worked in C#, it will work in Java". If anyone has a suggestion, I'd love to hear it.

 

Howard's picture
Offline
Last seen: 1 day 6 hours ago
Joined: 11/29/2012
Posts: 565

For a string that large, you should definitely look into using unbounded strings.  You have to regenerate the type support code using "--unboundedSupport"...in addition you probably will want to use the following properties to configure when Connext DDS dynamically allocates the memory for the string (versus statically).

I note that the documentation you pointed to was for RTI Connext DDS 5.2.3...which is a fairly old version.  You probably will want to make sure you're referring to the docs for the version that you're using.

            <datawriter_qos>
                <!-- This property is needed when using -unboundedSupport command-line option
                 in order to configure the memory allocation policy for the buffers that are
                 used to serialize the samples -->                
                <property>
                    <value>
                        <element>
                           <name>
                           dds.data_writer.history.memory_manager.fast_pool.pool_buffer_max_size
                           </name>
                           <value>4096</value>
                        </element>
                    </value>
                </property>
            </datawriter_qos>

            <datareader_qos>
                <!-- This property is needed when using -unboundedSupport command-line option
                in order to configure the memory allocation policy for the buffers that are
                used to keep the serialized keys for the instances -->        
                <property>
                    <value>
                        <element>
                            <name>
                            dds.data_reader.history.memory_manager.fast_pool.pool_buffer_max_size
                            </name>
                            <value>4096</value>
                        </element>
                    </value>
               </property>
            </datareader_qos>

 

Offline
Last seen: 2 years 10 months ago
Joined: 04/24/2020
Posts: 9

Thanks to Howard - this worked for me:

  • Regenerate the type support using Unbounded Support checkbox (no difference)
  • Modify the IDL to make the string unbounded - Changed "string<2147483647> zzz" To "string zzz".
  • Regenerate the type support using Unbounded Support checkbox (now unbounded)
  • Modify my QoS file to include datawriter_qos and datareader_qos sections suggested above
  • No changes needed to my subscriber class.
Howard's picture
Offline
Last seen: 1 day 6 hours ago
Joined: 11/29/2012
Posts: 565

Great to hear!