11.9. ExampleΒΆ
In this section, there is a full XML example with all possible configuration.
Warning
This example can be used as a quick reference, but it may not be correct due to incompatibility or exclusive properties. Do not take it as a working example.
1<?xml version="1.0" encoding="UTF-8" ?>
2<dds>
3 <profiles xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles" >
4 <transport_descriptors>
5 <transport_descriptor>
6 <transport_id>ExampleTransportId1</transport_id>
7 <type>TCPv4</type>
8 <sendBufferSize>8192</sendBufferSize>
9 <receiveBufferSize>8192</receiveBufferSize>
10 <TTL>250</TTL>
11 <maxMessageSize>16384</maxMessageSize>
12 <maxInitialPeersRange>100</maxInitialPeersRange>
13 <interfaceWhiteList>
14 <address>192.168.1.41</address>
15 <address>127.0.0.1</address>
16 </interfaceWhiteList>
17 <wan_addr>80.80.55.44</wan_addr>
18 <keep_alive_frequency_ms>5000</keep_alive_frequency_ms>
19 <keep_alive_timeout_ms>25000</keep_alive_timeout_ms>
20 <max_logical_port>200</max_logical_port>
21 <logical_port_range>20</logical_port_range>
22 <logical_port_increment>2</logical_port_increment>
23 <listening_ports>
24 <port>5100</port>
25 <port>5200</port>
26 </listening_ports>
27 </transport_descriptor>
28 <transport_descriptor>
29 <transport_id>ExampleTransportId2</transport_id>
30 <type>UDPv6</type>
31 </transport_descriptor>
32 <!-- SHM sample transport descriptor -->
33 <transport_descriptor>
34 <transport_id>SHM_SAMPLE_DESCRIPTOR</transport_id>
35 <type>SHM</type> <!-- REQUIRED -->
36 <maxMessageSize>524288</maxMessageSize> <!-- OPTIONAL uint32 valid of all transports-->
37 <segment_size>1048576</segment_size> <!-- OPTIONAL uint32 SHM only-->
38 <port_queue_capacity>1024</port_queue_capacity> <!-- OPTIONAL uint32 SHM only-->
39 <healthy_check_timeout_ms>250</healthy_check_timeout_ms> <!-- OPTIONAL uint32 SHM only-->
40 <rtps_dump_file>test_file.dump</rtps_dump_file> <!-- OPTIONAL string SHM only-->
41 </transport_descriptor>
42 </transport_descriptors>
43
44 <participant profile_name="participant_profile_example">
45 <domainId>4</domainId>
46 <rtps>
47 <name>Participant Name</name> <!-- String -->
48
49 <defaultUnicastLocatorList>
50 <locator>
51 <udpv4>
52 <!-- Access as physical, like UDP -->
53 <port>7400</port>
54 <address>192.168.1.41</address>
55 </udpv4>
56 </locator>
57 <locator>
58 <tcpv4>
59 <!-- Both physical and logical (port), like TCP -->
60 <physical_port>5100</physical_port>
61 <port>7400</port>
62 <unique_lan_id>192.168.1.1.1.1.2.55</unique_lan_id>
63 <wan_address>80.80.99.45</wan_address>
64 <address>192.168.1.55</address>
65 </tcpv4>
66 </locator>
67 <locator>
68 <udpv6>
69 <port>8844</port>
70 <address>::1</address>
71 </udpv6>
72 </locator>
73 </defaultUnicastLocatorList>
74
75 <defaultMulticastLocatorList>
76 <locator>
77 <udpv4>
78 <!-- Access as physical, like UDP -->
79 <port>7400</port>
80 <address>192.168.1.41</address>
81 </udpv4>
82 </locator>
83 <locator>
84 <tcpv4>
85 <!-- Both physical and logical (port), like TCP -->
86 <physical_port>5100</physical_port>
87 <port>7400</port>
88 <unique_lan_id>192.168.1.1.1.1.2.55</unique_lan_id>
89 <wan_address>80.80.99.45</wan_address>
90 <address>192.168.1.55</address>
91 </tcpv4>
92 </locator>
93 <locator>
94 <udpv6>
95 <port>8844</port>
96 <address>::1</address>
97 </udpv6>
98 </locator>
99 </defaultMulticastLocatorList>
100
101 <sendSocketBufferSize>8192</sendSocketBufferSize>
102
103 <listenSocketBufferSize>8192</listenSocketBufferSize>
104
105 <builtin>
106 <discovery_config>
107
108 <discoveryProtocol>NONE</discoveryProtocol>
109
110 <EDP>SIMPLE</EDP>
111
112 <leaseDuration>
113 <sec>DURATION_INFINITY</sec>
114 </leaseDuration>
115
116 <leaseAnnouncement>
117 <sec>1</sec>
118 <nanosec>856000</nanosec>
119 </leaseAnnouncement>
120
121 <simpleEDP>
122 <PUBWRITER_SUBREADER>true</PUBWRITER_SUBREADER>
123 <PUBREADER_SUBWRITER>true</PUBREADER_SUBWRITER>
124 </simpleEDP>
125
126 <staticEndpointXMLFilename>filename.xml</staticEndpointXMLFilename>
127
128 </discovery_config>
129
130 <use_WriterLivelinessProtocol>false</use_WriterLivelinessProtocol>
131
132 <metatrafficUnicastLocatorList>
133 <locator>
134 <udpv4>
135 <!-- Access as physical, like UDP -->
136 <port>7400</port>
137 <address>192.168.1.41</address>
138 </udpv4>
139 </locator>
140 <locator>
141 <tcpv4>
142 <!-- Both physical and logical (port), like TCP -->
143 <physical_port>5100</physical_port>
144 <port>7400</port>
145 <unique_lan_id>192.168.1.1.1.1.2.55</unique_lan_id>
146 <wan_address>80.80.99.45</wan_address>
147 <address>192.168.1.55</address>
148 </tcpv4>
149 </locator>
150 <locator>
151 <udpv6>
152 <port>8844</port>
153 <address>::1</address>
154 </udpv6>
155 </locator>
156 </metatrafficUnicastLocatorList>
157
158 <metatrafficMulticastLocatorList>
159 <locator>
160 <udpv4>
161 <!-- Access as physical, like UDP -->
162 <port>7400</port>
163 <address>192.168.1.41</address>
164 </udpv4>
165 </locator>
166 <locator>
167 <tcpv4>
168 <!-- Both physical and logical (port), like TCP -->
169 <physical_port>5100</physical_port>
170 <port>7400</port>
171 <unique_lan_id>192.168.1.1.1.1.2.55</unique_lan_id>
172 <wan_address>80.80.99.45</wan_address>
173 <address>192.168.1.55</address>
174 </tcpv4>
175 </locator>
176 <locator>
177 <udpv6>
178 <port>8844</port>
179 <address>::1</address>
180 </udpv6>
181 </locator>
182 </metatrafficMulticastLocatorList>
183
184 <initialPeersList>
185 <locator>
186 <udpv4>
187 <!-- Access as physical, like UDP -->
188 <port>7400</port>
189 <address>192.168.1.41</address>
190 </udpv4>
191 </locator>
192 <locator>
193 <tcpv4>
194 <!-- Both physical and logical (port), like TCP -->
195 <physical_port>5100</physical_port>
196 <port>7400</port>
197 <unique_lan_id>192.168.1.1.1.1.2.55</unique_lan_id>
198 <wan_address>80.80.99.45</wan_address>
199 <address>192.168.1.55</address>
200 </tcpv4>
201 </locator>
202 <locator>
203 <udpv6>
204 <port>8844</port>
205 <address>::1</address>
206 </udpv6>
207 </locator>
208 </initialPeersList>
209
210 <readerHistoryMemoryPolicy>PREALLOCATED_WITH_REALLOC</readerHistoryMemoryPolicy>
211
212 <writerHistoryMemoryPolicy>PREALLOCATED</writerHistoryMemoryPolicy>
213 </builtin>
214
215 <allocation>
216 <remote_locators>
217 <max_unicast_locators>4</max_unicast_locators> <!-- uint32 -->
218 <max_multicast_locators>1</max_multicast_locators> <!-- uint32 -->
219 </remote_locators>
220 <total_participants>
221 <initial>0</initial>
222 <maximum>0</maximum>
223 <increment>1</increment>
224 </total_participants>
225 <total_readers>
226 <initial>0</initial>
227 <maximum>0</maximum>
228 <increment>1</increment>
229 </total_readers>
230 <total_writers>
231 <initial>0</initial>
232 <maximum>0</maximum>
233 <increment>1</increment>
234 </total_writers>
235 <max_partitions>256</max_partitions>
236 <max_user_data>256</max_user_data>
237 <max_properties>512</max_properties>
238 </allocation>
239
240 <port>
241 <portBase>7400</portBase>
242 <domainIDGain>200</domainIDGain>
243 <participantIDGain>10</participantIDGain>
244 <offsetd0>0</offsetd0>
245 <offsetd1>1</offsetd1>
246 <offsetd2>2</offsetd2>
247 <offsetd3>3</offsetd3>
248 </port>
249
250 <participantID>99</participantID>
251
252 <throughputController>
253 <bytesPerPeriod>8192</bytesPerPeriod>
254 <periodMillisecs>1000</periodMillisecs>
255 </throughputController>
256
257 <userTransports>
258 <transport_id>ExampleTransportId1</transport_id>
259 <transport_id>ExampleTransportId1</transport_id>
260 </userTransports>
261
262 <useBuiltinTransports>false</useBuiltinTransports>
263
264 <propertiesPolicy>
265 <properties>
266 <property>
267 <name>Property1Name</name>
268 <value>Property1Value</value>
269 <propagate>false</propagate>
270 </property>
271 <property>
272 <name>Property2Name</name>
273 <value>Property2Value</value>
274 <propagate>false</propagate>
275 </property>
276 </properties>
277 </propertiesPolicy>
278 </rtps>
279 </participant>
280
281 <data_writer profile_name="datawriter_profile_example">
282 <topic>
283 <kind>WITH_KEY</kind>
284 <name>TopicName</name>
285 <dataType>TopicDataTypeName</dataType>
286 <historyQos>
287 <kind>KEEP_LAST</kind>
288 <depth>20</depth>
289 </historyQos>
290 <resourceLimitsQos>
291 <max_samples>5</max_samples>
292 <max_instances>2</max_instances>
293 <max_samples_per_instance>1</max_samples_per_instance>
294 <allocated_samples>20</allocated_samples>
295 </resourceLimitsQos>
296 </topic>
297
298 <qos> <!-- dataWriterQosPoliciesType -->
299 <durability>
300 <kind>VOLATILE</kind>
301 </durability>
302 <liveliness>
303 <kind>AUTOMATIC</kind>
304 <lease_duration>
305 <sec>1</sec>
306 <nanosec>856000</nanosec>
307 </lease_duration>
308 <announcement_period>
309 <sec>1</sec>
310 <nanosec>856000</nanosec>
311 </announcement_period>
312 </liveliness>
313 <reliability>
314 <kind>BEST_EFFORT</kind>
315 <max_blocking_time>
316 <sec>1</sec>
317 <nanosec>856000</nanosec>
318 </max_blocking_time>
319 </reliability>
320 <lifespan>
321 <duration>
322 <sec>5</sec>
323 <nanosec>0</nanosec>
324 </duration>
325 </lifespan>
326 <partition>
327 <names>
328 <name>part1</name>
329 <name>part2</name>
330 </names>
331 </partition>
332 <publishMode>
333 <kind>ASYNCHRONOUS</kind>
334 </publishMode>
335 <disablePositiveAcks>
336 <enabled>true</enabled>
337 <duration>
338 <sec>1</sec>
339 </duration>
340 </disablePositiveAcks>
341 </qos>
342
343 <times>
344 <initialHeartbeatDelay>
345 <sec>1</sec>
346 <nanosec>856000</nanosec>
347 </initialHeartbeatDelay>
348 <heartbeatPeriod>
349 <sec>1</sec>
350 <nanosec>856000</nanosec>
351 </heartbeatPeriod>
352 <nackResponseDelay>
353 <sec>1</sec>
354 <nanosec>856000</nanosec>
355 </nackResponseDelay>
356 <nackSupressionDuration>
357 <sec>1</sec>
358 <nanosec>856000</nanosec>
359 </nackSupressionDuration>
360 </times>
361
362 <unicastLocatorList>
363 <locator>
364 <udpv4>
365 <!-- Access as physical, like UDP -->
366 <port>7400</port>
367 <address>192.168.1.41</address>
368 </udpv4>
369 </locator>
370 <locator>
371 <tcpv4>
372 <!-- Both physical and logical (port), like TCP -->
373 <physical_port>5100</physical_port>
374 <port>7400</port>
375 <unique_lan_id>192.168.1.1.1.1.2.55</unique_lan_id>
376 <wan_address>80.80.99.45</wan_address>
377 <address>192.168.1.55</address>
378 </tcpv4>
379 </locator>
380 <locator>
381 <udpv6>
382 <port>8844</port>
383 <address>::1</address>
384 </udpv6>
385 </locator>
386 </unicastLocatorList>
387
388 <multicastLocatorList>
389 <locator>
390 <udpv4>
391 <!-- Access as physical, like UDP -->
392 <port>7400</port>
393 <address>192.168.1.41</address>
394 </udpv4>
395 </locator>
396 <locator>
397 <tcpv4>
398 <!-- Both physical and logical (port), like TCP -->
399 <physical_port>5100</physical_port>
400 <port>7400</port>
401 <unique_lan_id>192.168.1.1.1.1.2.55</unique_lan_id>
402 <wan_address>80.80.99.45</wan_address>
403 <address>192.168.1.55</address>
404 </tcpv4>
405 </locator>
406 <locator>
407 <udpv6>
408 <port>8844</port>
409 <address>::1</address>
410 </udpv6>
411 </locator>
412 </multicastLocatorList>
413
414 <throughputController>
415 <bytesPerPeriod>8192</bytesPerPeriod>
416 <periodMillisecs>1000</periodMillisecs>
417 </throughputController>
418
419 <historyMemoryPolicy>DYNAMIC</historyMemoryPolicy>
420
421 <matchedSubscribersAllocation>
422 <initial>3</initial>
423 <maximum>3</maximum>
424 <increment>0</increment>
425 </matchedSubscribersAllocation>
426
427 <propertiesPolicy>
428 <properties>
429 <property>
430 <name>Property1Name</name>
431 <value>Property1Value</value>
432 <propagate>false</propagate>
433 </property>
434 <property>
435 <name>Property2Name</name>
436 <value>Property2Value</value>
437 <propagate>false</propagate>
438 </property>
439 </properties>
440 </propertiesPolicy>
441
442 <userDefinedID>45</userDefinedID>
443
444 <entityID>76</entityID>
445 </data_writer>
446
447 <data_reader profile_name="datareader_profile_example">
448 <topic>
449 <kind>WITH_KEY</kind>
450 <name>TopicName</name>
451 <dataType>TopicDataTypeName</dataType>
452 <historyQos>
453 <kind>KEEP_LAST</kind>
454 <depth>20</depth>
455 </historyQos>
456 <resourceLimitsQos>
457 <max_samples>5</max_samples>
458 <max_instances>2</max_instances>
459 <max_samples_per_instance>1</max_samples_per_instance>
460 <allocated_samples>20</allocated_samples>
461 </resourceLimitsQos>
462 </topic>
463
464 <qos> <!-- dataReaderQosPoliciesType -->
465 <durability>
466 <kind>PERSISTENT</kind>
467 </durability>
468 <liveliness>
469 <kind>MANUAL_BY_PARTICIPANT</kind>
470 <lease_duration>
471 <sec>1</sec>
472 <nanosec>856000</nanosec>
473 </lease_duration>
474 <announcement_period>
475 <sec>1</sec>
476 <nanosec>856000</nanosec>
477 </announcement_period>
478 </liveliness>
479 <reliability>
480 <kind>BEST_EFFORT</kind>
481 <max_blocking_time>
482 <sec>1</sec>
483 <nanosec>856000</nanosec>
484 </max_blocking_time>
485 </reliability>
486 <lifespan>
487 <duration>
488 <sec>5</sec>
489 <nanosec>0</nanosec>
490 </duration>
491 </lifespan>
492 <partition>
493 <names>
494 <name>part1</name>
495 <name>part2</name>
496 </names>
497 </partition>
498 </qos>
499
500 <times>
501 <initialAcknackDelay>
502 <sec>1</sec>
503 <nanosec>856000</nanosec>
504 </initialAcknackDelay>
505 <heartbeatResponseDelay>
506 <sec>1</sec>
507 <nanosec>856000</nanosec>
508 </heartbeatResponseDelay>
509 </times>
510
511 <unicastLocatorList>
512 <locator>
513 <udpv4>
514 <!-- Access as physical, like UDP -->
515 <port>7400</port>
516 <address>192.168.1.41</address>
517 </udpv4>
518 </locator>
519 <locator>
520 <tcpv4>
521 <!-- Both physical and logical (port), like TCP -->
522 <physical_port>5100</physical_port>
523 <port>7400</port>
524 <unique_lan_id>192.168.1.1.1.1.2.55</unique_lan_id>
525 <wan_address>80.80.99.45</wan_address>
526 <address>192.168.1.55</address>
527 </tcpv4>
528 </locator>
529 <locator>
530 <udpv6>
531 <port>8844</port>
532 <address>::1</address>
533 </udpv6>
534 </locator>
535 </unicastLocatorList>
536
537 <multicastLocatorList>
538 <locator>
539 <udpv4>
540 <!-- Access as physical, like UDP -->
541 <port>7400</port>
542 <address>192.168.1.41</address>
543 </udpv4>
544 </locator>
545 <locator>
546 <tcpv4>
547 <!-- Both physical and logical (port), like TCP -->
548 <physical_port>5100</physical_port>
549 <port>7400</port>
550 <unique_lan_id>192.168.1.1.1.1.2.55</unique_lan_id>
551 <wan_address>80.80.99.45</wan_address>
552 <address>192.168.1.55</address>
553 </tcpv4>
554 </locator>
555 <locator>
556 <udpv6>
557 <port>8844</port>
558 <address>::1</address>
559 </udpv6>
560 </locator>
561 </multicastLocatorList>
562
563 <expectsInlineQos>true</expectsInlineQos>
564
565 <historyMemoryPolicy>DYNAMIC</historyMemoryPolicy>
566
567 <matchedPublishersAllocation>
568 <initial>1</initial>
569 <maximum>1</maximum>
570 <increment>0</increment>
571 </matchedPublishersAllocation>
572
573 <propertiesPolicy>
574 <properties>
575 <property>
576 <name>Property1Name</name>
577 <value>Property1Value</value>
578 <propagate>false</propagate>
579 </property>
580 <property>
581 <name>Property2Name</name>
582 <value>Property2Value</value>
583 <propagate>false</propagate>
584 </property>
585 </properties>
586 </propertiesPolicy>
587
588 <userDefinedID>55</userDefinedID>
589
590 <entityID>66</entityID>
591 </data_reader>
592 </profiles>
593
594 <log>
595 <use_default>FALSE</use_default>
596
597 <consumer>
598 <class>StdoutConsumer</class>
599 </consumer>
600
601 <consumer>
602 <class>FileConsumer</class>
603 <property>
604 <name>filename</name>
605 <value>execution.log</value>
606 </property>
607 <property>
608 <name>append</name>
609 <value>TRUE</value>
610 </property>
611 </consumer>
612 </log>
613
614 <types>
615 <type> <!-- Types can be defined in its own type of tag or sharing the same tag -->
616 <enum name="MyAloneEnumType">
617 <enumerator name="A" value="0"/>
618 <enumerator name="B" value="1"/>
619 <enumerator name="C" value="2"/>
620 </enum>
621 </type>
622 <type>
623 <enum name="MyEnum">
624 <enumerator name="A" value="0"/>
625 <enumerator name="B" value="1"/>
626 <enumerator name="C" value="2"/>
627 </enum>
628
629 <typedef name="MyAlias1" type="nonBasic" nonBasicTypeName="MyEnum"/>
630
631 <typedef name="MyAlias2" type="int32" arrayDimensions="2,2"/>
632
633 <typedef name="my_map_inner" type="int32" key_type="int32" mapMaxLength="2"/>
634
635 <bitset name="MyBitSet">
636 <bitfield name="a" bit_bound="3"/>
637 <bitfield name="b" bit_bound="10"/>
638 <bitfield name="c" bit_bound="12" type="int16"/>
639 </bitset>
640
641 <bitmask name="MyBitMask" bit_bound="8">
642 <bit_value name="flag0" position="0"/>
643 <bit_value name="flag1"/>
644 </bitmask>
645
646 <struct name="MyStruct">
647 <member name="first" type="int32"/>
648 <member name="second" type="int64"/>
649 </struct>
650
651 <struct name="OtherStruct">
652 <member name="my_enum" type="nonBasic" nonBasicTypeName="MyEnum"/>
653 <member name="my_struct" type="nonBasic" nonBasicTypeName="MyStruct" arrayDimensions="5"/>
654 </struct>
655
656 <union name="MyUnion1">
657 <discriminator type="byte"/>
658 <case>
659 <caseDiscriminator value="0"/>
660 <caseDiscriminator value="1"/>
661 <member name="first" type="int32"/>
662 </case>
663 <case>
664 <caseDiscriminator value="2"/>
665 <member name="second" type="nonBasic" nonBasicTypeName="MyStruct"/>
666 </case>
667 <case>
668 <caseDiscriminator value="default"/>
669 <member name="third" type="int64"/>
670 </case>
671 </union>
672
673 <!-- All possible members struct type -->
674 <struct name="MyFullStruct">
675 <!-- Primitives & basic -->
676 <member name="my_bool" type="boolean"/>
677 <member name="my_byte" type="byte"/>
678 <member name="my_char" type="char8"/>
679 <member name="my_wchar" type="char16"/>
680 <member name="my_short" type="int16"/>
681 <member name="my_long" type="int32"/>
682 <member name="my_longlong" type="int64"/>
683 <member name="my_unsignedshort" type="uint16"/>
684 <member name="my_unsignedlong" type="uint32"/>
685 <member name="my_unsignedlonglong" type="uint64"/>
686 <member name="my_float" type="float32"/>
687 <member name="my_double" type="float64"/>
688 <member name="my_longdouble" type="float128"/>
689 <member name="my_string" type="string"/>
690 <member name="my_wstring" type="wstring"/>
691 <member name="my_boundedString" type="string" stringMaxLength="41925"/>
692 <member name="my_boundedWString" type="wstring" stringMaxLength="41925"/>
693
694 <!-- long long_array[2][3][4]; -->
695 <member name="long_array" arrayDimensions="2,3,4" type="int32"/>
696
697 <!-- map<long,map<long,long,2>,2> my_map_map; -->
698 <member name="my_map_map" type="nonBasic" nonBasicTypeName="my_map_inner" key_type="int32" mapMaxLength="2"/>
699
700 <!-- Complex types -->
701 <member name="my_other_struct" type="nonBasic" nonBasicTypeName="OtherStruct"/>
702 </struct>
703 </type>
704 </types>
705</dds>