eclipse-cyclonedds / cyclonedds

Eclipse Cyclone DDS project
https://projects.eclipse.org/projects/iot.cyclonedds
Other
891 stars 363 forks source link

Does CycloneDDS automatically group subscribers into multicast groups based on topic? #2067

Open xiaoyuyaa555 opened 3 months ago

xiaoyuyaa555 commented 3 months ago

Hi,

I would like to understand how CycloneDDS handles multicast grouping for subscribers. Specifically, does CycloneDDS automatically group subscribers into different multicast groups based on the topic they are subscribing to? Or is this process something that needs to be manually configured?

Thank you!

eboasson commented 1 month ago

I would love for it to do that automatically, but no, you have to configure that via the Partitioning element in the configuration. Something like:

<?xml version="1.0" encoding="UTF-8" ?>
<CycloneDDS xmlns="https://cdds.io/config">
  <Domain Id="any">
    <General>
      <Interfaces>
        <NetworkInterface name="lo0" priority="default" multicast="true"/>
        <NetworkInterface name="en0" priority="default" multicast="true"/>
      </Interfaces>
    </General>
    <Partitioning>
      <NetworkPartitions>
        <NetworkPartition Name="a" Address="239.255.0.1"/>
        <NetworkPartition Name="b" Address="239.255.0.2"/>
        <NetworkPartition Name="c" Address="239.255.0.3"/>
      </NetworkPartitions>
      <PartitionMappings>
        <PartitionMapping DCPSPartitionTopic="a.*" NetworkPartition="a"/>
        <PartitionMapping DCPSPartitionTopic="b.*" NetworkPartition="b"/>
        <PartitionMapping DCPSPartitionTopic="*.*" NetworkPartition="c"/>
      </PartitionMappings>
    </Partitioning>
  </Domain>
</CycloneDDS>
xiaoyuyaa555 commented 1 month ago

Thank you very much for your answer. I will configure it through XML.