Dynamically modify history QoS

2 posts / 0 new
Last post
Offline
Last seen: 3 years 11 months ago
Joined: 08/25/2015
Posts: 32
Dynamically modify history QoS

Hi,


I'm trying to modify the history qos on the fly - I've already created a DataReader. But when I try to set the new QoS policy I get an exception telling me this QoS is immutable (dds::core::ImmutablePolicyError):

terminate called after throwing an instance of 'dds::core::ImmutablePolicyError' what(): [D0100|Reader(80000007)|T=LTS_TestParticipant|SET_QOS]PRESPsService_setLocalEndpointProperty:!copyToReaderRW [D0100|Reader(80000007)|T=LTS_TestParticipant|SET_QOS]DDS_DataReader_set_qos:ERROR: Failed to set reader QoS set DataReader qos

So how can I modify this qos?

 

Thx,

Christian

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

Hello Christian,

Some qos can be changed even after the entity is created and some others no. From the manual

The values of some QosPolicies cannot be changed after the Entity is created or after the Entity is enabled. Others may be changed at any time. The detailed section on each QosPolicy states when each policy can be changed. If you attempt to change a QosPolicy after it becomesimmutable (because the associated Entity has been created or enabled, depending on the policy), set_qos() will fail with a return code ofIMMUTABLE_POLICY.

You can check out the full chapter here.

The only way would be to delete the reader, change the qos and create a new one with that QoS. 

Does it make sense?

Best,
  Gianpiero