Creating a Distributed Logger with custom QoS

2 posts / 0 new
Last post
Offline
Last seen: 8 years 8 months ago
Joined: 03/15/2016
Posts: 1
Creating a Distributed Logger with custom QoS

I am attempting to create a distributed logger using a custom QoS. I have created the following XML file:

 


 

<dds xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:noNamespaceSchemaLocation="http://community.rti.com/schema/5.2.0/rti_dds_qos_profiles.xsd" version="5.2.0">

<!-- Qos Library -->

<qos_library name="CustomQosLib">

<qos_profile name="CustomQos" base_name="BuiltinQosLib::Baseline.5.2.0"> <participant_qos>

<resource_limits>

<topic_data_max_length>512</topic_data_max_length>

</resource_limits>

</participant_qos>

</qos_profile>

</qos_library>

</dds>


 

I am making the domain particpiant factory aware of the custom qos with the following code.


 

DDS_DomainParticipantFactoryQos factory_qos;

DDSTheParticipantFactory->get_qos(factory_qos);

factory_qos.profile.url_profile.ensure_length(1, 1);

factory_qos.profile.url_profile[0] = DDS_String_dup("/valid/path/to/distributed_logger_qos.xml");

DDSTheParticipantFactory->set_qos(factory_qos);


 

When I use the following code, the distributed logger is correctly created with my custom qos.

 


 

RTI_DLOptions dlOptions;

dlOptions.setDomainId(_domain);

dlOptions.setApplicationKind("DistLogging");

dlOptions.setEchoToStdout(true);

DDSDomainParticipant* part = DDSTheParticipantFactory->create_participant_with_profile(_domain, "CustomQosLib", "CustomQos", NULL, DDS_STATUS_MASK_NONE);

dlOptions.setDomainParticipant(part);

 

RTI_DLDistLogger::setOptions(dlOptions);

_distributedLogger = RTI_DLDistLogger::getInstance();


 

When I try the following code:

 


 

RTI_DLOptions dlOptions;

dlOptions.setDomainId(_domain);

dlOptions.setApplicationKind("DistLogging");

dlOptions.setEchoToStdout(true);

dlOptions.setQosLibrary("CustomQosLib");

dlOptions.setQosProfile("CustomQos");

 

RTI_DLDistLogger::setOptions(dlOptions);

_distributedLogger = RTI_DLDistLogger::getInstance();


 

 

I get the following console output.

"DL Warning: RTI_DL_DDSEntities_create: QoS Library and Profile cannot be found, using default QoS"

Am I misinterpreting what setQosLibrary and setQosProfile do / what their input parameters should be? For code maintainability it would be preferable to not create the participant myself, but I can't seem to get the factory to acknowledge the qos inside of the construction of the distributed logger.

 

-Andrew

 

Gonzalo J.'s picture
Offline
Last seen: 8 years 8 months ago
Joined: 03/06/2015
Posts: 2

Hi Andrew,

I just wanted to let you know that I was able to reproduce this behavior and confirm it as an issue. The reason is that we use different DomainParticipantFactories for the C and C++ APIs: as Distributed Logger is written in C, when no custom DomainParticipant is provided, Distributed Logger will create its own DomainParticipant from the C DomainParticipantFactory. Therefore, if you set a different QoS profile path in the C++ DomainParticipantFactory, these changes will not be reflected in DistributedLogger.

The workaround is to pass a custom DomainParticipant to DistributedLogger, created with the appropriate DomainParticipantFactory settings.

PS: Please note that this will change the DomainParticipantFactory that Distributed Logger will use to retrieve QoS settings for other entities. If you provide a DomainParticipant created from a C++ DomainParticipantFactory through setDomainParticipant, you can still set a QoS library and profile through setQosLibrary and setQosPath. DL will use this information to load the right QoS settings when creating the remaining Distributed Logger entities.

Regards,

Gonzalo J.