2. Advanced XML configurationΒΆ

This XML configures an advanced Discovery Server topology in which multiple servers, with publishers and subscribers, have multiple clients with publishers and subscribers in turn. This example also shows how to launch participants and endpoints during the execution of the Discovery Server tool. Under the snapshots tag are specified the times at which a snapshot of the discovery state will be taken.

  1<?xml version="1.0" encoding="utf-8"?>
  2<DS xmlns="http://www.eprosima.com/XMLSchemas/discovery-server" user_shutdown="false">
  3
  4    <servers>
  5        <server name="server1" profile_name="UDP_server1" />
  6        <server name="server2" prefix="44.49.53.43.53.45.52.56.45.52.5f.32" profile_name="UDP_server2">
  7            <subscriber topic="topic1" removal_time="20"/>
  8        </server>
  9        <server name="server3" prefix="44.49.53.43.53.45.52.56.45.52.5f.33" profile_name="UDP_server3" removal_time="60">
 10            <subscriber topic="topic1" removal_time="10"/>
 11            <subscriber topic="topic2" creation_time="17"/>
 12        </server>
 13    </servers>
 14
 15    <clients>
 16        <client removal_time="40" name="client1_server1" profile_name="UDP_client1_server1">
 17            <publisher removal_time="30" topic="topic1"/>
 18        </client>
 19        <client creation_time="50" name="client2_server1" profile_name="UDP_client2_server1">
 20            <publisher creation_time="50" topic="topic2"/>
 21        </client>
 22    </clients>
 23
 24    <snapshots file="./test_14_disposals_remote_servers.snapshot~">
 25
 26        <!-- Starting point -->
 27        <snapshot time="8">test_14_disposals_remote_servers_snapshot_1</snapshot>
 28        <!-- Remove subscriber1 from server3 -->
 29        <snapshot time="15">test_14_disposals_remote_servers_snapshot_2</snapshot>
 30        <!--
 31            Remove subscriber1 from server2
 32            Create subscriber2 in server3
 33         -->
 34        <snapshot time="25">test_14_disposals_remote_servers_snapshot_3</snapshot>
 35        <!-- Remove publisher 1 from client1_server1 -->
 36        <snapshot time="35">test_14_disposals_remote_servers_snapshot_4</snapshot>
 37        <!-- Remove client1_server1 -->
 38        <snapshot time="45">test_14_disposals_remote_servers_snapshot_5</snapshot>
 39        <!--
 40            Create client2_server1
 41            Create a publisher in client2_server1
 42         -->
 43        <snapshot time="55">test_14_disposals_remote_servers_snapshot_6</snapshot>
 44        <!-- Remove server3 -->
 45        <snapshot time="65">test_14_disposals_remote_servers_snapshot_7</snapshot>
 46
 47    </snapshots>
 48
 49    <profiles>
 50        <participant profile_name="UDP_client1_server1" >
 51            <rtps>
 52                <prefix>63.6c.69.65.6e.74.31.5f.73.31.5f.5f</prefix>
 53                <builtin>
 54                    <discovery_config>
 55                        <discoveryProtocol>CLIENT</discoveryProtocol>
 56                        <discoveryServersList>
 57                            <RemoteServer prefix="44.49.53.43.53.45.52.56.45.52.5F.31">
 58                                <metatrafficUnicastLocatorList>
 59                                    <locator>
 60                                        <udpv4>
 61                                            <address>127.0.0.1</address>
 62                                            <port>14811</port>
 63                                        </udpv4>
 64                                    </locator>
 65                                </metatrafficUnicastLocatorList>
 66                            </RemoteServer>
 67                        </discoveryServersList>
 68                    </discovery_config>
 69                </builtin>
 70            </rtps>
 71        </participant>
 72
 73        <participant profile_name="UDP_client2_server1" >
 74            <rtps>
 75                <prefix>63.6c.69.65.6e.74.32.5f.73.31.5f.5f</prefix>
 76                <builtin>
 77                    <discovery_config>
 78                        <discoveryProtocol>CLIENT</discoveryProtocol>
 79                        <discoveryServersList>
 80                            <RemoteServer prefix="44.49.53.43.53.45.52.56.45.52.5F.31">
 81                                <metatrafficUnicastLocatorList>
 82                                    <locator>
 83                                        <udpv4>
 84                                            <address>127.0.0.1</address>
 85                                            <port>14811</port>
 86                                        </udpv4>
 87                                    </locator>
 88                                </metatrafficUnicastLocatorList>
 89                            </RemoteServer>
 90                        </discoveryServersList>
 91                    </discovery_config>
 92                </builtin>
 93            </rtps>
 94        </participant>
 95
 96        <participant profile_name="UDP_server1">
 97            <rtps>
 98                <prefix>44.49.53.43.53.45.52.56.45.52.5F.31</prefix>
 99                <builtin>
100                    <discovery_config>
101                        <discoveryProtocol>SERVER</discoveryProtocol>
102                    </discovery_config>
103                    <metatrafficUnicastLocatorList>
104                        <locator>
105                            <udpv4>
106                                <address>127.0.0.1</address>
107                                <port>14811</port>
108                            </udpv4>
109                        </locator>
110                    </metatrafficUnicastLocatorList>
111                </builtin>
112            </rtps>
113        </participant>
114
115        <participant profile_name="UDP_server2">
116            <rtps>
117                <prefix>44.49.53.43.53.45.52.56.45.52.5F.32</prefix>
118                <builtin>
119                    <discovery_config>
120                        <discoveryServersList>
121                            <RemoteServer prefix="44.49.53.43.53.45.52.56.45.52.5F.31">
122                                <metatrafficUnicastLocatorList>
123                                    <locator>
124                                        <udpv4>
125                                            <address>127.0.0.1</address>
126                                            <port>14811</port>
127                                        </udpv4>
128                                    </locator>
129                                </metatrafficUnicastLocatorList>
130                            </RemoteServer>
131                        </discoveryServersList>
132                        <discoveryProtocol>SERVER</discoveryProtocol>
133                    </discovery_config>
134                    <metatrafficUnicastLocatorList>
135                        <locator>
136                            <udpv4>
137                                <address>127.0.0.1</address>
138                                <port>14812</port>
139                            </udpv4>
140                        </locator>
141                    </metatrafficUnicastLocatorList>
142                </builtin>
143            </rtps>
144        </participant>
145
146        <participant profile_name="UDP_server3">
147            <rtps>
148                <prefix>44.49.53.43.53.45.52.56.45.52.5F.33</prefix>
149                <builtin>
150                    <discovery_config>
151                        <discoveryServersList>
152                            <RemoteServer prefix="44.49.53.43.53.45.52.56.45.52.5F.32">
153                                <metatrafficUnicastLocatorList>
154                                    <locator>
155                                        <udpv4>
156                                            <address>127.0.0.1</address>
157                                            <port>14812</port>
158                                        </udpv4>
159                                    </locator>
160                                </metatrafficUnicastLocatorList>
161                            </RemoteServer>
162                        </discoveryServersList>
163                        <discoveryProtocol>SERVER</discoveryProtocol>
164                        <leaseAnnouncement>DURATION_INFINITY</leaseAnnouncement>
165                        <leaseDuration>DURATION_INFINITY</leaseDuration>
166                    </discovery_config>
167                    <metatrafficUnicastLocatorList>
168                        <locator>
169                            <udpv4>
170                                <address>127.0.0.1</address>
171                                <port>14813</port>
172                            </udpv4>
173                        </locator>
174                    </metatrafficUnicastLocatorList>
175                </builtin>
176            </rtps>
177        </participant>
178
179        <topic profile_name="topic1">
180            <name>topic_1</name>
181            <dataType>sample_type_1</dataType>
182        </topic>
183
184        <topic profile_name="topic2">
185            <name>topic_2</name>
186            <dataType>HelloWorld</dataType>
187        </topic>
188
189     </profiles>
190</DS>