To configure a DataReader with durable reader state, use the PROPERTY QosPolicy (DDS Extension) associated with DataReaders and DomainParticipants.
A property defined in the DomainParticipant will be applicable to all the DataReaders contained in the participant unless it is overwritten by the DataReaders. lists the supported properties.
Property |
Description |
dds.data_reader.state.odbc.dsn |
Required. The ODBC DSN (Data Source Name) associated with the database where the DataReader state must be persisted. |
dds.data_reader.state. |
To enable durable reader state, this property must be set to 1. When set to 0, the reader state is not maintained and Connext DDS does not filter duplicate samples that may be coming from the same virtual writer. Default: 1 |
dds.data_reader.state.odbc.driver |
This property indicates which ODBC driver to load. If the property is not specified, Connext DDS will try to use the standard ODBC driver manager library (UnixOdbc on UNIX/Linux systems, the Windows ODBC driver manager on Windows systems). |
dds.data_reader.state.odbc.username |
These two properties configure the username and password used to connect to the database. Default: No password or username |
dds.data_reader.state.odbc.password |
|
dds.data_ |
This property indicates if the persisted DataReader state must be restored or not once the DataReader is restarted. If this property is 0, the previous state will be deleted from the database. If it is 1, the DataReader will restore its previous state from the database content. Default: 1 |
dds.data_reader.state. |
This property controls how often the reader state is stored into the database. A value of N means store the state once every N samples. A high frequency will provide better performance. However, if the reader is restarted it may receive some duplicate samples. These samples will be filtered by Connext DDS and they will not be propagated to the application. Default: 1 |
dds.data_reader.state.persistence_ |
This property indicates how many of the most recent historical samples the persisted DataReader wants to receive upon start-up. Default: 0 |
/* Get default QoS */
... retcode = DDSPropertyQosPolicyHelper::add_property( readerQos.property, "dds.data_reader.state.odbc.dsn", "<user DSN>", DDS_BOOLEAN_FALSE); if (retcode != DDS_RETCODE_OK) { /* Report error */ } retcode = DDSPropertyQosPolicyHelper::add_property(readerQos.property, "dds.data_reader.state.odbc.driver", "<ODBC library>", DDS_BOOLEAN_FALSE); if (retcode != DDS_RETCODE_OK) { /* Report error */ } retcode = DDSPropertyQosPolicyHelper::add_property(readerQos.property, "dds.data_reader.state.restore", "<0|1>", DDS_BOOLEAN_FALSE); if (retcode != DDS_RETCODE_OK) { /* Report error */ } /* Create Data Reader */ ...
© 2016 RTI