Dynamic discovery of qos profile

7 posts / 0 new
Last post
Offline
Last seen: 6 years 10 months ago
Joined: 04/28/2013
Posts: 38
Dynamic discovery of qos profile

Hi, I'd like to know if there's any way to get the qos profile/library from discovery. What I'd like to do is discover publishers and open subscribers accordingly, but I didn't find a way to get the profile. 

The only solution I've found is statically mapping topic names to the respective library:: profile to use when opening the subscriber.

Is there a way to avoid this step and discover everything dynamically? 

Thanks

 

 

Gerardo Pardo's picture
Offline
Last seen: 3 weeks 6 days ago
Joined: 06/02/2010
Posts: 602

Hi Michael,

Which of these do you mean?

(a) When you discover a remote entity (say a DataWriter) you would like to find out the QoS profile that was used to configure that remote entity, that is you would like to have that profile name be propagated via discovery and see it in the PublicationsBuiltinTopicData (or SubscriptionsBuiltinTopicData)?

(b) When you create a DataReader/DataWriter you would like to have some sort of "profile discovery service" that would allow participant to lookup the peoper QoS profile that should be used to configure the created entity?

(c) Somethign else?

I think you meant (a) but I want to make sure I understand before I answer...

Gerardo

 

Offline
Last seen: 6 years 10 months ago
Joined: 04/28/2013
Posts: 38

Hi Gerardo,

You're right, I meant a.

 

Gerardo Pardo's picture
Offline
Last seen: 3 weeks 6 days ago
Joined: 06/02/2010
Posts: 602

Hi Michael,

Currently there is no built-in way to do this. The QoS profile used to create an entity is converted to the actual QoS and "forgotten" buy the core and discovery only sends the actual QoS values that are relevant to the other side so there is no way looking at discovery information to tell whether the entity was configured using a Qos profile and the name of said profile.

I agree this would be a very useful feature. In fact there is an internal RFE (request for enhancement) that in the situation where the entity was created using the create_xxx_with_profile() or modified with the set_qos_with_profile() then the DDS core would set a PropertyQosPolicy on the entity that would record the profile name so that it is visible in the discovery data. However this RFE has not been prioritized yet so I do not have a timeline for when it would be implemented... If this is an important/urgent feature for you?

Gerardo

Offline
Last seen: 6 years 10 months ago
Joined: 04/28/2013
Posts: 38

I wouldn't say it's very urgent, it's just a matter of convenience. 

Anyway,  thanks a lot for clearing it up

Michael

gianpiero's picture
Offline
Last seen: 10 months 2 weeks ago
Joined: 06/02/2010
Posts: 177

Michael,

Another option for now, is to add that information as a property yourself. Here how to do it in C but the same applies for other languages as well:

Let's assume that you are creating your participant this way:

const char * profileName = "MyParticipantLibrary::TICalculator";
struct DDS_DomainParticipantQos qos;
DDS_DomainParticipant *participant = NULL;
DDS_ReturnCode_t retcode; 
   
participant = DDS_DomainParticipantFactory_create_participant_from_config(DDS_TheParticipantFactory, profileName);
if (participant == NULL) {
 printf("Error: participant not created\n");
 return -1;
}
  

Now you can just get the qos:

retcode = DDS_DomainParticipant_get_qos(participant,&qos);
if (retcode != DDS_RETCODE_OK) {
 printf("Error: get qos failed \n");
 return -1;
}

add your property using the DDS_PropertyQosPolicyHelper_assert_property:

retcode = DDS_PropertyQosPolicyHelper_assert_property(
                    &qos.property,
                    "profileName",
                    profileName,
                    DDS_BOOLEAN_TRUE /*this tells to propagate this property with discovery*/);
if (retcode != DDS_RETCODE_OK) {
 printf("Error: set qos failed \n");
 return -1;
}

and set back the qos:

retcode = DDS_DomainParticipant_set_qos(participant,&qos);
if (retcode != DDS_RETCODE_OK) {
 printf("Error: set qos failed \n");
 return -1;
}

 

You can now retrieve that information using the discovery information. For example I verified that everything was working using RTI Admin Console as you can see in the following screenshot: 

 

Do you think this can work for you? Let me know if you have any questions or doubts,

Best,
  Gianpiero

 

Offline
Last seen: 6 years 10 months ago
Joined: 04/28/2013
Posts: 38

Hi Gianpiero,

That seems like a good idea,  I'll try to use it 

Thanks a lot,

Michael