Hi,
Iin my application, I have one subscriber and I have attached one datareader to it. I have attached multiple partitions to this subscriber.
The topic data corresponding to this data reader can be sent by multiple applications in different partitions.
Is it possible to know which of the partition of my subscriber has recieved the data from the instance i have recieved ?
I do not want to have more than one subscriber.
thanks & regards
Kapil
Hi Kapil,
In the SampleInfo structure that comes with a Data sample, there is a publication_handle that you can use to get the matched_publication_data, from which you can get the partition to which the DataWriter belongs.
Hi Howard,
I am using the RTI DDS 6.1 and its modern c++ api.
when I get samples, i iterate through them to get each sample and then as you answered I tried following 3 code segments, but none of them provides the matched_publication_data or the partition to which the DataWriter belongs.
Could you please look into it to provide me a solution:
Hi, I noticed that the hyperlinks in my last post were wrong (to my local installation directory). I've updated them to point at web-accessible URLs.
You need to use
auto publication_handle = sample.info().publication_handle();
and then
auto publication_matched_data = dds::sub::matched_publication_data(data_reader, publication_handle);
Hi Howard,
I am using the RTI DDS 6.1 and its modern c++ api.
First, a Topic (or key of Topic) may not be disposed just because the writer is killed. It depends on QoS settings like WriterDataLifeCycle.autodispose_unregistered_instances.
But if you want to detect that a writer has called the disposed() API on an instance/Topic, then you need to check for the InstanceState as provided in the SampleInfo structure when your code takes data from the DataReader.
A disposed() call will result in a data sample sent to the DataReader with "invalid" data. i.e., the user data itself isn't "real"/data actually sent by the user, but the associated SampleInfo does have new information.
In your processing code, after determining that a data sample is "invalid", you can check the sample.info().state().instance_state() and see if the state is equal to non_alive_disposed.
Thanks Howard
Hi Howard,
I am using the RTI DDS 6.1 and its modern c++ api.
You should be looking through the documentation. i.e., search for "coherent" in the Connext User's Manual
https://community.rti.com/static/documentation/connext-dds/6.1.1/doc/manuals/connext_dds_professional/users_manual/index.htm#users_manual/WritingCoherentSetsSample.htm?Highlight=coherent
https://community.rti.com/static/documentation/connext-dds/6.1.1/doc/manuals/connext_dds_professional/users_manual/index.htm#users_manual/PRESENTATION_QosPolicy.htm#sending_2410472787_1237370
as well as the HTML Documentation for the Presentation QoS:
https://community.rti.com/static/documentation/connext-dds/6.1.1/doc/api/connext_dds/api_cpp2/classdds_1_1core_1_1policy_1_1Presentation.html
and if you search for "coherent" on the community.rti.com website, you would find this example
https://community.rti.com/examples/coherent-presentation