DDS not ignoring local published data. PreviousNext
Data Distribution Service (DDS) Forum > DDS Hitchhiker's Forum >
Next message Chris Litchfield  posted on Wednesday, October 12, 2016 - 06:12 pm
I have a DDS test application that creates both a publisher and a subscriber to the same topic. I then publish data and all the instances of the application get the data. This allows me to have a common topic for many different publishers of the same data. Consider the shapes demo: Each instance can send a Square and any instance subscribing to the "Square" topic gets the square.

The Issue is that the local application that published the data would get the data as well. I have filtered using my actual internal transmitted data but this is going to be insufficient. I need the local subscriber to ignore all data from the local publisher. (Same binary, different threads).

Wait you say, isnt that what ignore_publication or ignore_participant is for? Supposedly but I have yet to get this to work correctly. I want to be able to subscribe to the topic but ignore the local publication data in that topic.

Well I have been unable to get those to work. I use the DevGuideExamples for messager.minimal in OpenDDS package to base my test example code. This code does not have the ignore* functionality in it and I have been unable to find any example code.

C++ code as follows in snippets:

DDS::DomainParticipantFactory_var dpf = TheParticipantFactoryWithArgs(argc_, argv_);
DDS::DomainParticipant_var participant = createParticipant(dpf, vm["domain"].as<int>());


// So this did not work. I checked the participant handle and it is "2" here.

then I created the DataPublisher and DataSubscriber

topic = createTopic(participant);
subscriber = createSubscriber(participant);

// I put the ignore participant here.. no dice either.. Whats interesting is subscriber->get_instance_handle() is "3"

listener_impl = new DataReaderListenerImple();
DDS:DataReaderListner_var listener(listener_impl);

reader = createDataReader(subscriber, topic, listener);


From what I understand, putting the participant->ignore_participant.. line should ignore all DATA from my own publishing. I am still getting the same data constantly from when I published, I get it back in my subscriber.

This has to be fundamental to a Pub/Sub that you don't receive your own data even if you subscribe to the same topic you publish.

DataPublisher dp(io_service, publish_queue, participant);
DataSubscriber ds(io_service, subscribe_queue, participant);
Next message Chris Litchfield  posted on Wednesday, October 12, 2016 - 06:15 pm
Sorry for any issues with posting, apparently Preview/Post does not give you the option to actually preview before it posts. I also see no way to edit the post
Back to top
Add Your Message Here
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Options: Post as "Anonymous"
Enable HTML code in message
Automatically activate URLs in message