Asserting relationships about publishers

2 posts / 0 new
Last post
Last seen: 3 years 4 months ago
Joined: 08/25/2015
Posts: 5
Asserting relationships about publishers

Simply put, I want it to be an error for my application to come up and create a publisher for a given topic if a publisher for that topic already exists on the network.  Is there some logic in DDS that can help me do this?


Last seen: 12 hours 19 min ago
Joined: 02/11/2016
Posts: 143

Hey stephendause,

The behavior you describe can be obtained in one of two ways I'm aware of:

1. Create a subscriber for that topic before creating the publisher and after some time test it for matches (this can be done via the listener or via the reader API)

Note: this option will cause data to flow from the writer to your reader.

2. Use the builtin topics to discover the existence of writers in the network

Note: this is a bit "heavy"


A note about both methods:

They are not "safe" (as in, it's possible that two or more writers will be created for a topic if they were all created at the same time) although there are methodologies to make them safer (but it's really complicated and ugly).


Why would you need this logic? perhaps there is a better solution (for example, if you want only one writer to update instances, you can use the strength qos)


Good luck,