I'm not sure what the details of your use-case are, but here are a few points to consider:
- Depending on the subscriber queue size and the rate at which you publish, publishing single Markers can either work well (if you don't overwhelm the subscriber queue) or not well (when you overwhelm the subscriber queue). In the latter case, messages get lost and not processed on the subscriber side.
- If you set Marker to have the same
namespace and id as a previous one,
the previous one should indeed
disappear (as it gets overwritten by
the new one if the action is set to
"add/modify", which is the default).
- If you publish multiple markers it is
recommended to use a MarkerArray
publisher, as this allows publishing
an array of Markers. This avoids the
problem with potentially
unpredictable behavior mentioned in
the first bullet.
- I'd recommend getting rid of the
latching for your publishers you
mentioned, at least for testing. If
you have multiple latched publishers
in a node (or multiple nodes latching
the same topic), the behavior can be
counterintuitive.