How to use 'USER_QOS_PROFILES.xml' in my DDS?

6 posts / 0 new
Last post
Last seen: 8 years 4 months ago
Joined: 11/25/2015
Posts: 14
How to use 'USER_QOS_PROFILES.xml' in my DDS?


I hope to use 'USER_QOS_PROFILES.xml' in my TestType DDS Application, but it is hard to adjust in my DDS.

I've already read libraries and documents, but there was no clear answer what I really want to know.

Let me summarize my questions,

1. How can I adjust 'USER_QOS_PROFILES.xml' in my test application? (I want to change qos' through xml file)

2. What should be added in test application code? Please answer me clearly and detail.


Thank you.

Last seen: 8 years 2 months ago
Joined: 01/09/2016
Posts: 8

From my small experience, the 'USER_QOS_PROFILES.xml' file should be in the directory from which you call the application, NOT from where the application actually is. Only then your application will load the xml file to override any default values. Hope this helps.

Last seen: 8 years 4 months ago
Joined: 11/25/2015
Posts: 14

Thanks for your comment.

I put xml file into real directory that contains application code.

What you mean that I should put this file in the release directory?

And, Should I change some codes to use USER_QOS_PROFILES?

I use only 'DDS_<entity>_DEFAULT_QOS'.


Thanks for your response.

Last seen: 8 years 2 months ago
Joined: 01/09/2016
Posts: 8

For me, I used the example code that is generated from the 'rtiddsgen' command.

You don't need to change your code in order to use the 'USER_QOS_PROFILES.xml' file. Just edit it, then run your application.

Remember: the USER_QOS_PROFILES.xml file must be in the directory of which you are executing the application (from command line). So if you are in directory X, and you are executing the application that is in path X\someDirectory\applicationDirectory, then the XML file should be in direcory X, NOT in 'applicationDirecytory'.

Hope it makes sense.

Last seen: 8 years 4 months ago
Joined: 11/25/2015
Posts: 14

Here is my clear question.

I made application with idl file (shapetype that is given from rti connext dds) and ran application with USER_QOS_PROFILES.xml 

I didn't move xml file after application had made. (It is in directory that original idl file was in before I made application with it)

Because I want to look some changes, I wrote some code in the ShapeType_Publisher.cxx

>> Here is an example.

/* To customize data writer QoS, use
the configuration file USER_QOS_PROFILES.xml */
writer = publisher->create_datawriter(
topic, DDS_DATAWRITER_QOS_DEFAULT, NULL /* listener */,
if (writer == NULL) {
printf("create_datawriter error\n");
return -1;

printf("best effort\n");


Before I modified some codes in ShapeType_Publisher.cxx, I had made some changes in USER_QOS_PROFILES.xml like this.


As you look, I added some xml codes under the datawriter_qos category.

Before I added this, there was only <publication_name> subcategory in the <datawriter_qos> category.


Then, I guess the console application would print "best-effort", but it printed on;y "reliable".

It never changed datawriter_qos.


This is my summarized quesitons.

1. If I changed USER_QOS_PROFILES.xml, Does it work in publication.cxx file?

2. I just put xml file in the code directory, not in debug or release directory, Was it right?


if (DDS_DATAWRITER_QOS_DEFAULT.reliability.kind == DDS_RELIABLE_RELIABILITY_QOS) {printf("reliable\n");} >> Is it right test code?


help me please.

gianpiero's picture
Last seen: 4 months 1 week ago
Joined: 06/02/2010
Posts: 177

Hello there,

I think the right things to do, would be to get the writer qos after you create it. And then to print it. Basically use the following test code instead of yours:

    DDS_DataWriterQos qos;
    if (qos.reliability.kind == DDS_RELIABLE_RELIABILITY_QOS) {
    } else {
        printf("Best Effort\n");


Let me know if that works!