Home

RTI Routing Service User Manual

image

Contents

1. Command ROUTINGSERVICEHOME AbiniS6Win32WS52008 rtiroutingse a C C Command Arguments cfgFile c adapters SimpleFileAdapter simple_file_adapter x H i Working Directory E Manifest Too Attach No Ed XML Document Generator Debugger Type Auto E Browse Information Envi E Build Events PICONET Custom Build Step Merge Environment Yes SQL Debugging No Command The debug command to execute e Inthe configuration combo box select Debug e Under Configuration Properties Debugging go to Command and add the fol lowing ROUTINGSERVICEHOME bin i86Win32VS2008 rtiroutingservice e Under Configuration Properties Debugging go to Command Arguments and add the following cfgFile c adapters SimpleFileAdapter simple file adapter xml cfg Name file to file e Click OK 1 The location of your configuration file may be different Replace the value with the right location 8 36 8 3 Creating New Adapters 8 3 4 2 8 3 5 8 3 5 1 5 Open the file SimpleFileAdapter c and insert breakpoints in the functions that you want to debug Then press F5 to run Routing Service and debug the adapter If you get an information window that says there is no debugging information in rtirout ingservice press YES Although rtiroutingservice does not have debugging symbols your adapter was built with debug information and you should not have any problems deb
2. sss eene nennen nennen 2 5 24 Routing A acu rd Hodge ar iri e He ERR QUI DRE NN 2 6 242 Doman RA ee Sn c ide tidie eee ee rete ote Sin ce eere ee Feb ue 2 8 24 3 Administra ON il nai ote eis n 2 13 244 o HA aieo gredi o ta Pee Dad irte te be beer bia Oye 2 14 245 SESSION sis cie tactic ee dete pee SR RR ERR elo enc ERES RL ER e eee Ee e e RON 2 19 24 6 AROUSA adie 2 21 DAT Auto Routes ooo enano ic AREE 2 30 e SC RN 2 34 2 5 Enabling and Disabling Routing Service Entities een 2 36 2 6 Enabling RTI Distributed Logger in Routing Service sss nee 2 37 2 7 Support for Extenrisible Iyp6S uei niece ile etin cabs hee RR aee Eres Hee ais 2 37 241 Example tees t Ed CI enel iaa 2 38 3 Running Routing Service 3 1 ptartine Routmmg Service doen dieit qtd eei deep ue bri aurei uve d tit rd 3 1 3 2 Dt ppi ig Routitig Service omita tetona 3 1 4 Transforming Data with Routing Service 4 1 Transformation Usage and Configuration cocncicncnninnnnnnnnnoncnnononancnncnnonononcnnno ran cncnnno no ran cn nnne nennen 4 1 4 2 Transformations Distributed with Routing Service sse eee eene 4 3 43 Creating New Transformations iii ic a iet remi re Dated a eee 4 4 43 1 Transformation Plugin API ueniet etse hier ei te tne bere tag 4 5 5 Administering Routing Service from a Remote Location 5 1 Enabling Remote Administration sss eene nennen nnne nnne nennen 5 1 iii
3. 1 Configuration Data for Routing Service Section 6 2 1 1 Configuration Data for a Domain Route Section 6 2 2 L Configuration Data for a Session Section 6 2 3 L Configuration Data for a Route Section 6 2 4 1 Configuration Data for an Auto Route Section 6 2 5 Each section describes the IDL for the topics underlying data types The IDL is also in the file Routing Service installation directory gt resource idl RoutingServiceMonitoring idl 6 2 6 2 Monitoring Configuration Data 6 2 1 Table 6 1 Configuration Data for Routing Service The topic that publishes configuration data is called rti routing service monitoring routing service data This topic describes the configuration of the routing service but not its contained entities The IDL definition of the data type is struct RoutingServiceAdministrationData String EXPRESSION MAX LENGTH save path boolean autosave on update E struct RoutingServiceData string lt ENTITY NAME MAX LENGTH gt name key string lt ENTITY_NAME MAX LENGTH group name string lt ENTITY NAME MAX LENGTH host name long host id long app id RoutingServiceAdministrationData administration hi Table 6 1 on page 6 3 describes the members of the RoutingServiceData data type RoutingServiceData Field Name Description Key field Name of the routing service instance The name associated with the routing service instance can be assigned explicitly na
4. 5 2 1 NN 5 3 D22 Cereales xe EA 5 3 5 2 9 vdeletez i ee RV O A Eta 5 4 524 cdisablecsc d ener ree e P pec e e ceti reete des e ved eee CY eoe eese i ve ede eus 5 4 b2 5 vxenablessne O teet soceri a ve tees n et e icc eie eL Ales 5 4 5 2 0 BOD ca ihase testae deme a ated Rte t Up Pte ie A eb 5 5 AR EN OO 5 5 PEN E A E TON 5 5 A A bem a pe Deed eva eb teet b et ct ii n 5 5 SNAM A NN NN 5 5 52I unload A A RU SoS b GE as ENS Bile e ARS 5 6 52 12 Updater dicci n rias 5 6 5 3 Accessing Routing Service from a Connext Application sss 5 8 6 Monitoring Routing Service from a Remote Location 6 1 Enabling Remote Monitori gissa e sete tedie obo He HE dt ie pede i den 6 2 6 2 Monitoring Configuration Data coonnicicnnnnnnnnnncnnonononnncnnnanononanonanano non an nennen ener nitent tenens 6 2 6 2 1 Configuration Data for Routing Service sssssssessseseee ee eene eene 6 3 6 22 Configuration Data for a Domain RoUt ccniciinionnninnnnnonncncncernnencanocinannnonononanonononananonononoso 6 4 6 23 Configuration Data for a Session see eae e teh te cite re ee 6 5 6 24 Configuration Data for a Route ee eee eene nnne nnne tenen 6 6 6 25 Configuration Data for an Auto Route eene eene nennen 6 10 6 3 Monitoring Status cree nere reete Hei Perge et tein de egent esee ies egos iri esae doi en ente Leste eyed ten 6 14 6 3 1 How the Statistics are Generated sse eterne enne nhne eret tnt ethernet
5. name filter output allow registered type name filter utput D E oup dds output inside auto route or auto topic route Topics that do not pass this filter in the output participant will not trigger the output creation of routes This filter is configured using the tag allow topic name filter inside auto topic route output or inside auto route dds output or the tag allow stream name filter inside auto route output Topics with types that do not pass this filter in the output participant will not trigger the creation of routes This filter is configured using the tag allow registered type name filter inside auto topic route output auto route dds ioutput or auto route output output deny stream name filter Topics that pass this filter in the output participant will not trigger the creation of routes The output deny topic name filter is configured using the tag deny topic name filter inside auto topic route output or inside auto route dds output or the tag deny stream name filter inside auto route output output deny registered type name filter Topics with types that pass this filter in the output participant will not trigger the creation of routes The output deny registered type name filter is configured using the tag deny registered type name filter inside auto topic route
6. y int SimpleFileAdapterStreamWriter write RTI RoutingServiceStreamWriter stream writer const RTI RoutingServiceSample sample list const RTI RoutingServiceSampleInfo info list int count RTI RoutingServiceEnvironment env int i samplesWritten 8 30 8 3 Creating New Adapters DDS DynamicData sample DDS ReturnCode t retCode char line struct SimpleFileAdapterStreamWriter self struct SimpleFileAdapterStreamWriter stream writer int verbosity verbosity RTI RoutingServiceEnvironment get verbosity env if verbosity RTI ROUTING SERVICE VERBOSITY DEBUG printf CALL SimpleFileAdapterStreamWriter write n if self gt fHandle return 0 samplesWritten 0 for i 0 i lt count i sample DDS DynamicData sample_list i line NULL retCode DDS DynamicData get string sample amp line NULL value DDS DYNAMIC DATA MEMBER ID UNSPECIFIED if retCode DDS RETCODE OK RTI RoutingServiceEnvironment set error env Error assigning value else samplesWritten fputs line self gt fHandle fputs n self gt fHandle fflush self gt fHandle if self gt printToStdout printf s n line fflush stdout DDS String free line return samplesWritten Deletes a StreamWriter x void SimpleFileAdapterConnection delete stream writer RTI RoutingServiceConnection connection RTI RoutingServiceStreamWriter strea
7. lt domain_route gt tag The configuration of a lt connection_1 gt or lt participant_1 gt If it is a lt connection_1 gt the union discriminator is RII ROUTING SERVICE GENERIC ADAPTER KIND for a lt participant_1 gt the union discriminator is RTI ROUTING SERVICE DDS ADAPTER KIND Domain ID of the first domain route participant connection 1 cconnection 1 dds domam id This domain ID is configured using the XML tag domain id inside participant 1 connection 1 dds ae Unique identifier for the first participant participant_key q P P connection_1 generic plugin_name The name of the plugin used by the first connection lt connection_1 gt 6 4 6 2 Monitoring Configuration Data Table 6 2 6 2 3 DomainRouteData Field Name Description connection_1 generic property The sequence of properties defined in the tag lt property gt inside lt connection_1 gt The configuration of lt connection_2 gt or lt participant_2 gt If it is a lt connection_2 gt the union discriminator is RTI_ROUTING_SERVICE_GENERIC_ADAPTER_KIND for a lt participant_2 gt the union discriminator is RTI_ROUTING_SERVICE_DDS_ADAPTER_KIND connection_2 Domain ID of the second domain route participant cconnection 2 dds domaincid This domain ID is configured using the XML tag domain id inside participant 1 connection 2 dds participent key Unique id
8. prefix with dds transport TCPv4 tcp1 Description write buffer allocation Allocation settings applied to buffers used for an asynchronous non blocking write These settings configure the initial number of buffers the maximum number of buffers and the buffers to be allocated when more buffers are needed Default write buffer allocation initial count 4 LJ write buffer allocation max count 1000 1 write buffer allocation incremental count 10 Note that for the write buffer pool the max count is not set to unlimited This is to avoid having a fast writer quickly exhaust all the available system memory in case of a temporary network slowdown When this write buffer pool reaches the maximum the low level send command of the transport will fail at that point Connext will take the appropriate action retry to send or drop it according to the application s QoS if the transport is used for reliable communication the data will still be sent eventually control buffer allocation Allocation settings applied to buffers used to serialize and send control messages These settings configure the initial number of buffers the maximum number of buffers and the buffers to be allocated when more buffers are needed Default J control buffer allocation initial count 2 J control buffer allocation max count 1 unlimited 1 control buffer allocation incremental count 1 number of buffers will keep doub
9. resource schema rti routing service dtd gt lt dds gt lt dds gt We recommend including a reference to the XSD file in the XML documents this provides stricter validation and better auto completion than the corresponding DTD file 1 Leading and trailing spaces in enumeration fields will not be considered valid if you use the distributed XSD doc ument to do validation at run time with a code editor 2 4 2 4 XML Tags for Configuring Routing Service 2 4 XML Tags for Configuring Routing Service This section describes the XML tags you can use in a Routing Service configuration file The fol lowing diagram and Table 2 1 describe the top level tags allowed within the root lt dds gt tag qos library See RTI Core Libraries and Utilities User s Manual Ch 15 see note below 1 1 L Optional routing service Required Section 2 4 1 Note The RTI Core Libraries and Utilities User s Manual is located in lt Connext installation directory gt ndds lt version gt doc pdf RTI_CoreLibrariesAndUtilities_UsersManual pdf Table 2 1 Top level Tags in the Configuration File Number Tags within lt dds gt Description of Tags Allowed Specifies a library of adapter plugins adapter library See Adapters Section 2 4 8 and Chapter 8 Extending Routing 9 or more Service with Adapters Specifies a QoS library and profiles The contents of this tag are specified in the same manner as
10. tingServiceConnection ToStringFcn connection to string tingServiceAdapterEntity UpdateFcn connection update ion API Stream Writer API RTI RoutingServiceStreamWriter WriteFcn stream writer write RTI RoutingServiceAdapterEntity UpdateFcn stream writer update void user object RTI RoutingServiceAdapterEntity UpdateFcn session update Stream Reader API RTI RoutingServiceStreamReader ReadFcn stream reader read RTI RoutingServiceStreamReader ReturnLoanFcn stream reader return loan RTI RoutingServiceAdapterEntity UpdateFcn stream reader update The adapter plugin instance created by the entry point function must be initialized with the macro RTI RoutingServiceAdapterPlugin initialize part of the adapter API For example struct RTI RoutingServiceAdapterPlugin MyAdapterPlugin create const struct RTI RoutingServiceProperties properties RTI RoutingServiceEnvironment env struct RTI RoutingServiceAdapterPlugin adapter NULL struct RTI RoutingServiceVersion version 1 0 0 0 8 12 8 3 Creating New Adapters 8 3 2 1 8 3 2 2 Table 8 9 8 3 2 3 adapter calloc 1 sizeof struct RTI_RoutingServiceAdapterPlugin if adapter NULL RTI RoutingServiceEnvironment set error env Memory allocation error return NULL RTI RoutingServiceAdapterPlugin initialize adapter adapter gt plugin version version Assign the function pointers El Environment The la
11. Bitmap that specifies the verbosity of log messages from the transport Logging values 1 Oxffffffff do not change the current verbosity 0x00 silence 0x01 errors 0x02 warnings 0x04 local 0x08 remote 0x10 period O O O O O C 0x80 other used for control protocol tracing Default 1 Note the logging verbosity is a global property shared across multiple instances of the TCP transport If you create a new TCP Transport instance with logging_verbosity_bitmap different than 1 the change will affect all the other instances as well The default TCP transport verbosity is errors and warnings Note The option of 0x80 other is used only for tracing the internal control protocol Since the output is very verbose this feature is enabled only in the debug version of the TCP Transport library libnddstransporttcpd so LIBNDDSTRANSPORTD LIB outstanding_ connection_cookies Maximum number of outstanding connection cookies allowed by the transport when acting as server A connection cookie is a token provided by a server to a client it is used to establish a data connection Until the data connection is established the cookie cannot be reused by the server To avoid wasting memory it is good practice to set a cap on the maximum number of connection cookies pending connections When the maximum value is reached a client will not be able to connect to the server until new cookies become available Range 1 or
12. E lt types gt routing service name MyRoutingService gt lt domain_route gt 2 26 2 4 XML Tags for Configuring Routing Service lt connection_1 gt lt registered type name Position type name PointType gt connection 1 participant 2 registered type name Position type name PointType gt participant 2 session topic route input participant 2 gt registered type name gt Position lt registered type name gt input output output topic route session domain route routing service dds The type description is done using the Connext XML format for type definitions For more infor mation see Section 3 4 in the RTI Core Libraries and Utilities User s Manual 2 4 6 3 Discovering Types If a route refers to types that are not defined in the configuration file Routing Service has to dis cover their type representation e g typecode A route cannot be created without the type repre sentation information By default the StreamReader creation will be tied to the discovery of types e g typecodes in the input domain and the StreamWriter creation will be tied to the discovery of types e g type codes in the output domain If you want to use types discovered in either one of the domains for the creation of both the StreamReader and StreamWriter you must set the route types tag to true In the following example both the Stre
13. NDDS_Transport_TCPv4_Property_t Property Name prefix with dds transport TCPv4 tcp1 Description transport priority mapping low transport priority mapping high Sets the low and high values of the output range to IPv4 TOS These values are used in conjunction with transport priority mask to define the map ping from Connext transport priority to the IPv4 TOS field Defines the low and high values of the output range for scaling Note that IPv4 TOS is generally an 8 bit value Default transport priority mapping low 0 Default transport priority mapping high OxFF server socket backlog Determines the maximum length of the queue of pending connections Default 5 public address Required for WAN communication Public IP address and port WAN address and port associated with the transport instantiation The address and port must be separated with For example 10 10 9 10 4567 This field is only used when parent classid is NDDS TRANSPORT CLASSID TCPV4 WAN or NDDS TRANSPORT CLASSID TLSV4 WAN The public address and port are necessary to support communication over a WAN that involves Network Address Translators NATs Typically the address is the public address of the IP router that provides access to the WAN The port is the IP router port that is used to reach the private server bind port inside the LAN from the outside This value is expressed as a string in the form ip port wher
14. Oorl If the tag is not defined Routing Service will use the Connext defaults Configures the Publisher QoS for remote administration publisher qos i Oor1 If the tag is not defined Routing Service will use the Connext defaults Specifies the file that will contain the saved configuration It is empty by default A save path must be specified if you want to use the save Section 5 2 10 command If the file specified by save path already exists the file will be overwritten when save is executed save path Oor1 This value is mutable when an update Section 5 2 12 command tar gets a routing service This value is sent as part of the monitoring configuration data for the routing service see Configuration Data for Routing Service Section 6 2 1 Configures the Subscriber QoS for remote administration subscriber qos Oor1 If the tag is not defined Routing Service will use the Connext defaults Monitoring You can create a Connext application that can remotely monitor the status of Routing Service To enable remote monitoring and configure its behavior use the monitoring and entity monitoring tags By default remote monitoring is turned off in Routing Service for security and performance rea sons A remote monitoring section is not required in the configuration file For example lt dds gt lt routing service gt lt enabled gt true lt enabled gt lt monitoring gt lt
15. can be configured The creation mode tag in a route s input and output tags controls when the routing ser vice StreamReader StreamWriter is created Table2 14 lists the possible values for the creation mode tag Creation Modes creation mode Values Description The route StreamReader StreamWriter is created as soon as possible that is as soon as the types are available Note that if the type is defined in the configura IMMEDIATE default tion file the creation will occur when the routing service starts If the type is not defined in the configuration file it has to be discovered see Discovering Types Section 2 4 6 3 The route StreamReader is not created until the associated connection discov ersa data Producer on the same stream For example for a domain Routing Service will not create the route DataReader until a DataWriter for the same topic is discovered on the same domain ON DOMAIN MATCH j ia The routing service StreamWriter is not created until the associated connection discovers a data Consumer on the same stream For example for a domain Routing Service will not create the route DataWriter until a DataReader for the same topic is discovered on the same domain The routing service StreamReader StreamWriter is not created until its coun ON BOUL MATER terpart in the route is created ON_DOMAIN_AND_ ROUTE_MATCH Both conditions must be true ON_DOMAIN_
16. file malloc strlen self gt directory strlen strlen stream_info gt stream_name strlen txt 1 if file NULL RTI_RoutingServiceEnvironment_set_error env Memory allocation error free writer return NULL sprintf file s s txt self gt directory stream info stream name 8 32 8 3 Creating New Adapters 8 3 3 8 writer gt fHandle fopen file w if writer gt fHandle NULL RTI_RoutingServiceEnvironment_set_error env Error opening s file free file free writer return NULL free file Creates notification thread printToStdoutStr RTI RoutingServiceProperties lookup property properties print to stdout if printToStdoutStr NULL writer gt printToStdout atoi printToStdoutStr else writer gt printToStdout 0 return writer The value of the RTI RoutingServiceAdapterPlugin structure created SimpleFileAdapter_create must be updated to contain the StreamWriter functions adapter gt connection create stream writer SimpleFileAdapterConnection create stream writer adapter connection delete stream writer SimpleFileAdapterConnection delete stream writer adapter stream writer write SimpleFileAdapterStreamWriter write Running the SimpleFileAdapter in This section describes the steps required to use and run the SimpleFileAdapter with Routing Ser vice You will create a configura
17. lt dds gt lt routing_service gt the properties in the route QoS values in the topic route will be completely replaced with the properties QoS values defined in the XML code If a QoS value for a topic route is not defined in the XML code Routing Service will use the Connext default Accessing Routing Service from a Connext Application You can create a DataWriter for the command topic to write Routing Service administration commands and optionally create a DataReader for the response topic to receive confirmations A more powerful and easier way is to use the Request Reply API only available with Connext Messaging You can create a Requester for these topics that will write command requests and wait for confirmations The topics are M rti routing service administration command request 1 rti routing service administration command response The types are L RTI RoutingService Administration CommandRequest RTI RoutingService Administration CommandResponse You can find the IDL definitions for these types in Routing Service installation directory resource idl RoutingServiceA dministration idl The QoS configurations of yur DataWriter and DataReader or your Requester if you are using the Request Reply API must be compatible with the one used by the routing service see how this is configured in Section 2 4 3 When you send an XML string URL str lt xml_code gt with the load and update commands if the string
18. lt output gt lt registered type name gt ShapeType lt registered type name gt topic name Triangle topic name output topic routes delete delete target routing service entity name You can invoke the delete command on domain routes routes and auto routes It acts like the disable Section 5 2 4 command but also purges the configuration data for the target entity For example delete example DomainRoute Session CirclesToCircles A deleted entity cannot be re enabled but a new one can be created disable disable target routing service entity name The disable command disables a routing service entity by destroying its sub entities and corre sponding DDS objects I Routing service When a routing service is disabled all of its domain routes are destroyed You do not need to specify the entity name to disable a routing service Domain route When a domain route is disabled all its routes topic routes auto routes and auto topic routes are destroyed as well as both Connections DomainParticipants for DDS All the session threads are stopped and their corresponding adapter sessions Publisher and Subscriber for DDS are also deleted 1 Route topic route auto route and auto topic route When a route topic route auto route or auto topic route is disabled its StreamReaders and StreamWriters are destroyed so data will no longer be routed enable enable target routing service
19. lt topic_route gt lt input gt lt datareader_qos gt lt deadline gt lt period gt lt sec gt 1 lt sec gt lt period gt lt deadline gt lt datareader_qos gt lt input gt lt topic_route gt or update ShapeRouter DomainRoutel Sessionl SquareToCircles topic route input datareader qos deadline period sec 1 The topic route DomainRoutel Session1 SquareToCircles will only change the period value in the Deadline QoS for that particular DataReader Now suppose that later on you send this command update ShapeRouter DomainRoutel Sessionl SquareToCircles str lt topic_route gt lt input gt lt datareader_qos gt lt property gt 5 7 5 3 Accessing Routing Service from a Connext Application 5 3 lt value gt lt element gt lt name gt MyProp lt name gt lt value gt MyValueRemote lt value gt lt element gt lt value gt lt property gt lt datareader_gos gt lt input gt lt topic_route gt This would only change the Property QoS the Deadline QoS would keep the setting from the prior command In both cases an update command can only reconfigure one entity at a time and Routing Service will ignore all contained entities For example a command to update a session will not modify the configuration of its contained routes If you need to reconfigure sev eral entities at the same time consider using the load command described in Section 5 2 7 1 If you send a well formed configuration file starting with
20. private NotificationThread notificationThread null private DynamicData dynamicData null private void parseProperties Properties properties ai String readPeriodStr readPeriodStr properties getProperty read period if readPeriodStr null readPeriod 1000 else readPeriod new Integer readPeriodStr intValue SimpleFileAdapterStreamReader StreamReaderListener listener StreamInfo streamInfo Properties properties String directory String verbosity throws AdapterException this verbosity verbosity parseProperties properties fileName streamInfo getStreamName txt try fileReader new BufferedReader new FileReader new File directory fileName catch IOException e throw new AdapterException 0 error opening fileName dynamicData new DynamicData TypeCode streamInfo getTypeInfo getTypeRepresentation DynamicData PROPERTY DEFAULT notificationThread new NotificationThread this listener fileReader readPeriod notificationThread start void close throws AdapterException try notificationThread terminate notificationThread join if fileReader null fileReader close catch InterruptedException e throw new AdapterException 0 8 47 8 3 Creating New Adapters error finishing notification thread catch IOException e throw new AdapterExce
21. readPeriod 1000 1000000 reader gt run 1 reader gt listener listener ifdef RTI WIN32 reader gt thread HANDLE _beginthread void __cdecl void SimpleFileAdapterStreamReader run 0 void reader if reader gt thread error 1 else pthread attr init amp threadAttr pthread attr setdetachstate amp threadAttr PTHREAD CREATE JOINABLE error pthread create amp reader gt thread amp threadAttr SimpleFileAdapterStreamReader run void reader pthread attr destroy amp threadAttr endif if error RTI RoutingServiceEnvironment set error env Error creating notification thread DDS DynamicData delete reader sample 0 free reader fclose reader gt fHandle return NULL return reader The value of the RTI RoutingServiceAdapterPlugin structure created in SimpleFileAdapter_create must be updated to contain the StreamReader functions adapter gt connection create_stream reader SimpleFileAdapterConnection create_stream reader adapter gt connection delete_stream reader SimpleFileAdapterConnection delete_stream reader adapter gt stream_reader_read SimpleFileAdapterStreamReader read 8 29 8 3 Creating New Adapters 8 3 3 7 adapter gt stream reader return loan SimpleFileAdapterStreamReader return loan Implementing the StreamWriter The connection objects are factories of StreamWriters A StreamWriter provides a way to wri
22. routing service name key string lt ENTITY NAME MAX LENGTH domain route name key string lt ENTITY NAME MAX LENGTH name key long enabled route count sequence lt Property MAX PROPERTIES property y Table 6 3 describes the fields in the SessionData data type 1 See lt Connext installation directory ndds version doc pdf RTI_CoreLibrariesAndUtilities_UsersManual pdf 6 2 Monitoring Configuration Data Table 6 3 SessionData 6 2 4 Field Name Description Key field routing service name The routing service name assigned using appName Key field domain route name The domain route name Key field name Lo j The session name which is configured with the name attribute in the session tag enabled route count The number of enabled routes property The sequence of properties defined in the tag lt property gt inside session Session data samples are published when LJ The session is enabled 1 The session is disabled dispose sample LJ An auto route route inside the session is enabled LJ An auto route route inside the session is disabled LI Monitoring is enabled via remote administration Configuration Data for a Route The topic that publishes route configuration data is called rti routing service monitoring route data The IDL definition of the data type RTI RoutingService Monitoring RouteData is struct
23. 0 amp amp str length 1 n str length 1 0 if length gt 1 amp amp str length 2 r str length 2 0 retCode DDS DynamicData set string self gt sample 0 value DDS DYNAMIC DATA MEMBER ID UNSPECIFIED line if retCode DDS RETCODE OK RTI RoutingServiceEnvironment set error env Error assigning value s line return sample list RTI RoutingServiceSample self gt sample count 1 return Notification thread This thread will notify of data availability in the file 27 void SimpleFileAdapterStreamReader_run void threadParam struct SimpleFileAdapterStreamReader self struct SimpleFileAdapterStreamReader threadParam while self gt run NDDS Utility sleep amp self readPeriod if feof self gt fHandle self listener on data available self self gt listener listener data 8 26 8 3 Creating New Adapters return NULL Deletes a StreamReader ay void SimpleFileAdapterConnection delete stream reader RTI_RoutingServiceConnection connection RTI_RoutingServiceStreamReader stream_reader RTI_RoutingServiceEnvironment env struct SimpleFileAdapterStreamReader reader struct SimpleFileAdapterStreamReader stream_reader ifndef RTI_WIN32 void value NULL endif int verbosity verbosity RTI_RoutingServiceEnvironment_get_verbosity env if verbosity RTI_ROUTING SERVICE VE
24. 1 sizeof struct SimpleFileAdapterStreamReader if reader NULL RTI_RoutingServiceEnvironment_set_error env Memory allocation error return NULL reader gt sample 0 DDS DynamicData new struct DDS TypeCode stream_info gt type info type representation amp dynamicDataProps if reader sample 0 NULL RTI RoutingServiceEnvironment set error env Failure creating dynamic data sample free reader return NULL Open input file file malloc strlen self directory strlen strlen stream info stream name strlen txt 1 if file NULL RTI RoutingServiceEnvironment set error env Memory allocation error DDS DynamicData delete reader sample 0 free reader return NULL sprintf file s s txt self gt directory stream info stream name reader fHandle fopen file r if reader gt fHandle NULL RTI_RoutingServiceEnvironment_set_error env Error opening s file free file DDS DynamicData delete reader gt sample 0 free reader return NULL 8 28 8 3 Creating New Adapters free file Creates notification thread readPeriodStr RTI RoutingServiceProperties lookup property properties read period if readPeriodStr NULL readPeriod atoi readPeriodStr else readPeriod 1000 1 Sec reader gt readPeriod sec readPeriod 1000 reader gt readPeriod nanosec
25. 2 7 Monitoring tags T Number of Tags within ipti monitoring DRUPO Alla Specifies which domain ID Routing Service will use to enable remote lt domain_id gt tee monitoring 1 required Enables disables general remote monitoring Setting this value to true default value in the lt monitoring gt tag under routing service enables monitoring in all the entities unless they explicitly disable it by setting this tag to false in their enabled local entity monitoring tags Oorl Setting this tag to false in the lt monitoring gt tag under routing service disables monitoring in all the Routing Service entities In this case any monitoring configuration settings in the entities are ignored Enables or disables the publication of statistics calculated within fixed time windows By default Routing Service only publishes the statistics correspond ing to the window between two status publications By using this tag you can get the following additional windows LJ 5 seconds 1 1 minute 1 5 minutes LJ 1 hour 21 Up time since the entity was enabled lt historical_statistics gt Oor1 For example historical statistics five second true five second one minute true c one minute five minute gt false lt five_minute gt one hour true one hour lt up_time gt false lt up_time gt lt historical_statistics gt If a window is not present inside the tag lt historic
26. 6 14 6 3 2 Status Information for the Routing Service sse eee eene 6 16 6 33 Domain Route Status acie eee aedes i he e ed dn ere da aee te od er kao sh doo e dae o PUn od 6 17 6 3 4 Status Information for a Session ccccccccessccssseessecsssessecessecsececssceseecssecesseeseeeseceeeceseeeascessece 6 18 6 3 5 Status Information for a Route ooccocccocnnonoconanoonnnonnconnnnonnonnnoonnonnnnonnnnnn conan conan nonan entere netten nent 6 19 6 3 6 Status Information for an Auto Route sees eene enne tenen tnnt enne 6 20 7 Traversing Wide Area Networks 7 TEP Communication Scenari S 5 eire tentes D suka celled pe e E ERR PEL Re EU ote EH pet ened 7 1 7 1 1 Communication Within a Single LAN sese e nennen nnne 7 1 7 1 2 Symmetric Communication Across NATS sse enne 7 2 7 1 3 Asymmetric Communication Across NATS sss eene 7 3 Fela Secure Communication 7 4 7 2 Configutitig the TEP Transport 6c ottenere ote eni eee E LNA SE aii aae 7 5 72 TGP Transport Initial Peers ix A A eh a na ne eee 7 5 7 22 Setting Up the TCP Transport Properties with the PropertyQoSPolicy s 7 5 7 2 3 TCP TLS Transport Properties ottenere A deo eet te itte 7 7 8 Extending Routing Service with Adapters 8 1 Adapter Usage and Configuration eee eene nenne nnne nnns 8 1 8 2 Adapter APL And Entity Model tette picado 8 2 8 2 1 Entity Crea OM s se rh e
27. DataReaders to the user DataWriters see Routes Section 2 4 6 When this functionality is enabled the user DataWriters receive the information about the data sets subscribed by the user DataReaders The DataWriters can use that information to do writer side filtering and propagate only the samples belonging to the subscribed data sets This results in a more efficient bandwidth usage as well as in less CPU consumption in the Routing Service instances and user DataReaders Figure 9 1 shows a scenario where communication between DataWriters and DataReaders is relayed through one or more Routing Services and filter propagation is not enabled The user DataWriters will send on the wire all the samples they publish since they cannot make assump tions about what user DataReaders want This default behavior incurs unnecessary bandwidth and CPU utilization since the filtering will occur on the DDS StreamWriter SWy System Behavior without Filter Propagation Communication direction 2E E TES ole 3 AN filtering cM Without propagation user DataWriters send all the samples filtering occurs on the last route s StreamWriter 1 The ability to perform writer side filtering is subject to some restrictions which are described in the RTI Core Library and Utilities User s Manual For the sake of this discussion we will assume that the configuration of DataReaders DataWriters and Routing Service instances is such t
28. Only applicable to DDS inputs dds input Defines the auto route s input stream topic See Auto Routes Sec 1 required tion 2 4 7 Only applicable to DDS outputs dds output Defines the auto route s output stream topic See Auto Routes Sec 1 required tion 2 4 7 Enables and configures remote monitoring for the auto route See entity monitoring Monitoring Section 2 4 4 and Chapter 6 Monitoring Routing Ser 0 or 1 vice from a Remote Location Only applicable to non DDS inputs input Defines the auto route s input stream See Auto Routes Section 1 required 2 4 7 Only applicable to non DDS outputs lt output gt Defines the auto route s output stream See Auto Routes Section 1 required 2 4 7 When this tag is true the data samples read from the input streams are written into the output streams with the same timestamp that was associated with them when they were made available in the lt publish_with_ input domain iod iginal ti t IA E This option may not be applicable in some adapter s implementa tions where the concept of timestamp is not supported Default false 2 32 2 4 XML Tags for Configuring Routing Service Table 2 17 Auto topic Route Tags Number of Tags within ET Description Tags auto topic route Allowed Enables and configures remote monitoring for the auto topic rou
29. Path to RTI Connext Java API DDS_CLASSPATH SROUTINGSERVICEHOME class nddsjava jar ALL SRC find routingservice adapter simplefile name X java mkdir p class Builds all files from routingservice to class echo Building all the sources in rtiroutingservice into class direc tory SJAVAC d class sourcepath classpath ADAPTER CLASSPATH DDS CLASSPATH SALL SRC SJAR cf class simplefileadapter jar C class routingservice rm rf class routingservice 8 3 6 3 Creating a Build Script for Windows Systems In this section you will create a script to compile the Java adapter 1 Create a directory that will contain the build script and the adapter implementation The rest of this section assumes that you will use c adapters SimpleFileAdapter as the adapter directory 2 In c adapters SimpleFileAdapter create a file called build cmd with the following content QECHO OFF REM HHHHHHHHHHHHEHHEEEEE REPRE RERERERER ERE RE EE E EF HF HF HF HF HHHBHBBEE REM RTI Routing Service Simple File Adapter REM HHHH HEHHEHE HE H HE H HE HE HHE HE HEHE HE H HE HE HEHE HE HE HE HE HE HE HEHE HE HE HE HE H HE HE HE HE HEHE HE H HE H H H H H H H HHH HHH HH SETLOCAL enabledelayedexpansion REM Get rid of quotes SET ROUTINGSERVICEHOME NQ ROUTINGSERVICEHOME REM Path to Java SET JAVAC javac exe SET JAR jar exe REM Path to RTI Routing Service Adapter API SET ADAPTER CLASSPATH ROUTINGSERVICEHOME NQ class rtirsadapter jar
30. Publisher five DataWriters for data publication one for each kind of entity and five DataWrit ers for status publication one for each kind of entity You can configure the QoS of these enti ties with the lt monitoring gt tag defined under lt routing_service gt The general remote monitoring parameters specified using the lt monitoring gt tag in lt routing_service gt except domain_id participant_qos publisher_qos and datawriter_qos can be overwritten on a per entity basis using the lt entity_monitoring gt tag For example lt dds gt lt routing service gt lt monitoring gt lt domain_id gt 55 lt domain_id gt lt status_publication_period gt lt sec gt 1 lt sec gt lt status publication period lt monitoring gt lt domain_route gt lt entity monitoring gt lt status_publication_period gt lt sec gt 4 lt sec gt lt status_publication_period gt lt entity_monitoring gt lt domain_route gt routing service dds Table 2 7 lists the tags allowed within monitoring tag Monitoring tags one Number of Tags within Description Tags lt monitoring gt Allowed Configures the DataWriter QoS for remote monitoring If the tag is not defined Routing Service will use the Connext defaults datawriter qos 0or1 with the following change durability kind DDS_TRANSIENT_LOCAL_DURABILITY_QOS 2 15 2 4 XML Tags for Configuring Routing Service Table
31. REM Path to RTI Connext Java API SET DDS CLASSPATH ROUTINGSERVICEHOME NQ NclassMnddsjava jar REM Ensure the objs directory exists IF NOT EXIST class MD class 8 40 8 3 Creating New Adapters 8 3 6 4 ECHO Building all the sources in routingservice into class directory FOR R routingservice F IN java DO JAVAC d class sourcepath classpath SADAPTER CLASSPATH DDS CLASSPATHS SSF SJAR cf class simplefileadapter jar C class routingservice RD S Q class routingservice Implementing the Adapter Class In this section you will create the adapter class for the simple file adapter Every Java adapter has to create an Adapter class that implements the com rti routingser vice adapter Adapter interface Adapter classes are registered with Routing Service using the tag lt class_name gt within lt java_adapter_plugin gt Section 8 1 Using your favorite Java editor create a file called SimpleFileAdapter java under lt Adapter directory gt routingservice adapter simplefile Insert the following content S EE K KR KK KK KK k k k k KR k ke k k k k KKK KR SSA Simple File Adapter EEE SSA package routingservice adapter simplefile import com rti routingservice adapter Adapter import com rti routingservice adapter Connection import com rti routingservice adapter StreamReaderListener import com rti routingservice adapter infrastructure AdapterException import com rti routingservice
32. Registers a type name and associates it with a type representation lt registered_type gt When you define a type in the configuration file with the types tag 0 or more you have to register the type in order to use it in routes See Route Types Section 2 4 6 1 Sequence of name value string pairs that can be used to configure the parameters of the connection For example lt property gt lt value gt lt property gt ii Dor 1 lt name gt jms connection username lt name gt lt value gt myusername lt value gt lt element gt lt value gt lt property gt 2 10 2 4 XML Tags for Configuring Routing Service Table 2 5 Participant Tags Number of Description Tags Allowed lt domain_id gt Sets the domain ID associated with the participant 1 required Tags within lt participant_1 2 gt Configures certain aspects of how Connext allocates internal memory The configuration is per domain_route s participant and therefore affects all the contained DataReaders and DataWriters For example lt domain_route name test gt lt participant_1 gt lt domain_id gt 0 lt domain_id gt lt memory management gt sample buffer min size X sample buffer min size sample buffer trim to size true sample buffer trim to size memory management gt lt participant_1 gt lt memory_ The lt memory_management gt tag can include the following tags l sample_bu
33. RoutingServiceConfigurableEntity UpdateFcn transformation update void user object The rest of this section introduces the different transformation functions For detailed informa tion about the API please see the online HTML Routing Service documentation I delete Deletes the transformation plugin instance typedef void RTI_RoutingServiceTransformationPlugin delete struct RTI RoutingServiceTransformationPlugin plugin RTI RoutingServiceEnvironment env create transformation Creates a new transformation The function is called when the route containing the trans formation is ready to forward data typedef RTI RoutingServiceTransformation RTI RoutingServiceTransformationPlugin create transformation struct RTI RoutingServiceTransformationPlugin plugin const struct RTI RoutingServiceTypeInfo input type info const struct RTI RoutingServiceTypeInfo output type info const struct RTI RoutingServiceProperties properties RTI RoutingServiceEnvironment env The behavior of the transformation can be configured using the properties parameter 4 5 4 3 Creating New Transformations delete transformation Deletes a transformation The function is called when the route containing the transfor mation is disabled typedef void RTI RoutingServiceTransformationPlugin delete transformation struct RTI RoutingServiceTransformationPlugin plugin RTI RoutingServiceTransfo
34. Section 2 4 6 1 0 or more lt participant_qos gt Sets the participant QoS The contents of this tag are specified in the same manner as a Connext QoS profile file see Chapter 15 in the RTI Core Libraries and Utilities User s Manual If not specified the DDS defaults are used except for the participant name which takes the following value RTI Routing Service lt service name gt lt domain route name gt 112 for example RTI Routing Service MyService MyDomainRoute 1 You can use a lt participant_qos gt tag inside a lt qos_library gt lt qos_profile gt previously defined in your configuration file by refer ring to it like this participant qos base _name MyLibrary MyProfile gt To use that profile but override just some values participant qos base _name MyLibrary MyProfile gt lt discovery gt lt initial_peers gt lt element gt udpv4 192 168 1 12 lt element gt lt element gt shmem lt element gt lt initial_peers gt lt discovery gt participant qos This applies to all QoS tags publisher qos subscriber qos in sessions datareader qos datawriter qos in topic routes and auto topic routes Oor1 1 See lt Connext installation directory ndds version doc pdf RTI CoreLibrariesAndUtilities UsersManual pdf 2 12 2 4 XML Tags for Configuring Routing Service 2 4 3 Administration You can create a Connext application
35. StreamReader is created the name of the file is the input stream name with a txt extension You can use the read_period property to control how often the StreamReader notifies Routing Service about new lines For example lt route name route gt lt input connection 1 gt lt stream_name gt HelloWorld lt stream_name gt registered type name gt TextLine lt registered type name gt property values element lt name gt read_period lt name gt lt value gt 1000 lt value gt lt element gt lt value gt lt property gt lt input gt lt M E In the above example the input StreamReader will read lines from a file called HelloWorld txt and provide one line per second to Routing Service The next step is to implement the StreamReader functionality You will implement five new functions L SimpleFileAdapterStreamReader read This function will be called by Routing Service after being notified that the are new lines available Although the signature of the func tion allows returning more than one sample line for the sake of simplicity the imple mentation only returns one line each time the function is called L SimpleFileAdapterStreamReader return loan The loan on the samples provided by SimpleFileAdapterStreamReader read is returned to the adapter using this function The SimpleFileAdapter implementation of return loan is empty because The read operation does not create new samples and always retu
36. architectures that provide a low level implemen tation of the TCP keep alive feature On Windows systems the TCP keep alive feature can be globally enabled through the system s registry NHKEY LOCAL MACHINENSYSTEM CurrentControlSetYTcpipYParameters Refer to MSDN documentation for more details On Solaris systems most of the TCP keep alive parameters can be changed though the kernel properties Default 0 keep_alive_time Specifies the interval of inactivity in seconds that causes TCP to generate a KEEP_ALIVE message This parameter is only supported on Linux architectures Default 1 OS default value keep_alive_interval Specifies the interval in seconds between KEEP_ALIVE retries This parameter is only supported on Linux architectures Default 1 OS default value keep_alive_retry_count The maximum number of KEEP_ALIVE retries before dropping the connection This parameter is only supported on Linux architectures Default 1 OS default value disable_nagle Disables the TCP nagle algorithm When this property is set to 1 TCP segments are always sent as soon as possible which may result in poor network utilization Default 0 7 12 7 2 Configuring the TCP Transport Table 7 1 TCP TLS Transport Properties over LAN or WAN NDDS_Transport_TCPv4_Property_t Property Name prefix with dds transport TCPv4 tcp1 Description logging verbosity bitmap
37. creation mode condition asso ciated with the lt output gt tag becomes true see Section 2 4 6 4 Implementation of this API is required only when there are routes using the adapter to produce data 8 5 8 2 Adapter API And Entity Model Table 8 4 Connection Operations Operation Description Deletes a previously created StreamWriter delete This method is called when the route is disabled or when the creation mode condition stream_writer associated with the lt output gt tag becomes false see Section 2 4 6 4 Implementation of this API is required only when there are routes using the adapter to produce data get_output_ stream_discovery_ reader Returns a StreamReader that is used by Routing Service to discover output streams An output stream is a stream to which StreamWriters can write data Disposed scenarios where an output stream disappears are also notified using the discovery Stream Reader For additional information see Stream Discovery Section 8 2 2 Implementation of this API is optional However if none of the adapters in a domain route implement the discovery API the routes types must be declared in the configura tion file get_input_stream_ discovery_reader Returns a StreamReader that is used by Routing Service to discover input streams An input stream is a stream from which a StreamReader can read data Disposed scenarios where an input stream disappears a
38. domain_id gt 55 lt domain_id gt lt status publication period gt lt sec gt 1 lt sec gt lt status publication period lt monitoring gt routing service dds Routing Service allows monitoring of the following kinds of entities I routing service see Section 2 4 1 1 domain route see Section 2 4 2 LI session see Section 2 4 5 LI route see Section 2 4 6 I topic route see Section 2 4 6 2 14 2 4 XML Tags for Configuring Routing Service Table 2 7 J auto route see Section 2 4 7 I auto topic route see Section 2 4 7 For each entity Routing Service can publish two kinds of information 1 Entity data l Entity status Entity data provides information about the configuration of the entity For example the route data contains information such as the stream name and the type name Entity data information is republished every time the entity is enabled disabled or has configuration changes Entity status provides information about the operational status of an entity This kind of infor mation changes continuously and is computed and published periodically For example the route status contains information such as the route s latency and throughput For more information about entity data and status see Chapter 6 Monitoring Routing Service from a Remote Location When remote monitoring is enabled Routing Service will create one DomainParticipant one
39. entity name gt The enable command enables an entity that has been disabled or marked as enabled false in the configuration file This command can be used to enable the following entities Routing service When a routing service is enabled it uses the currently loaded configu ration and starts You don t need to specify the entity name to enable a routing service J Domain route When a domain route is enabled it creates the participants routes topic routes auto routes and auto topic routes that it contains The routes topic routes auto routes and auto topic routes will be created enabled or disabled depending on their cur rent configuration Enabling a domain route is required to start routing data from the input domain to the output domain 5 4 5 2 Remote Commands 5 2 6 5 2 7 5 2 8 5 2 9 5 2 10 Route topic route auto route and auto topic route Enabling a route topic route auto route or auto topic route is a necessary condition to start routing data between input and output streams However data routing will not start until the StreamWriter and Stream Reader associated with a route are created see Section 2 4 6 4 for additional informa tion get get target routing service gt The get command retrieves the current configuration The retrieved configuration provided in an XML string format is functionally equivalent to the loaded XML file plus any updates either from an update com
40. for a Connext QoS profile file see Chapter 15 in the RTI Core Libraries and Utilities User s Manual qos library 0 or more Specifies a Routing Service configuration See Routing Service 1 or more routing service Section 2 4 1 required Specifies a library of transformation plugins transformation library See Data Transformation Section 2 4 6 5 and Chapter 4 Trans 0 or more forming Data with Routing Service 2 5 2 4 XML Tags for Configuring Routing Service Table 2 1 2 4 1 Top level Tags in the Configuration File Number Tags within lt dds gt Description y No Allowe Defines types that can be used by the routing service types nd A Oorl See Defining Types in the Configuration File Section 2 4 6 2 1 See lt Connext installation directory gt ndds lt version gt doc pdf RTI_CoreLibrariesAndUtilities_UsersManual pdf Routing Service A configuration file must have at least one lt routing_service gt tag this tag is used to configure an execution of Routing Service A configuration file may contain multiple lt routing_service gt tags When you start Routing Service you can specify which lt routing_service gt tag to use to configure the service using the cfgName command line parameter For example lt dds gt routing service name Routerl group name Groupl gt routing service gt routing service name Router2 g
41. header files defining the TypeCode and DynamicData APIs For information on how to install Connext see the RTI Core Libraries and Utilities Getting Started Guide As part of the installation process make sure that NDDSHOME points to the Connext installation directory 2 Set the environment variable ROUTINGSERVICEHOME Set ROUTINGSERVICEHOME to the Routing Service installation directory Routing Ser vice itself does not require that you set the environment variable It is used to build and compile new adapters Creating a Visual Studio Project Only for Windows systems In this section you will create a Visual Studio project for the adapter dynamic library We will use Microsoft Visual Studio 2008 1 Start Microsoft Visual Studio 2008 1 See lt Connext installation directory ndds version doc pdf RTI_CoreLibrariesAndUtilities_GettingStarted pdf 8 3 Creating New Adapters 2 Select File New Project Visual C Win32 Win32 Project Name the project Simple FileAdapter and select a location New Project HE x Project types Templates neT Framework 3 5 y 8 E Visual C Yisual Studio installed templates ATL CLR A Win32 Console Application E Win32 Project General MFC My Templates Smart Device Test search Online Templates Win32 Other Languages Other Project Types E Test Projects D E A project For creating a Win32 application console application DLL or static
42. higher or 1 which means an unlimited number Default 100 outstanding_ connection_cookies_ life_span Maximum lifespan in seconds of the cookies associated with pending connections If a client does not connect to the server before the lifespan of its cookie expires it will have to request a new cookie Range 1 second or higher or 1 Default 1 which means an unlimited amount of time effectively disabling the fea ture 7 13 7 2 Configuring the TCP Transport Table 7 1 TCP TLS Transport Properties over LAN or WAN NDDS_Transport_TCPv4_Property_t Property Name prefix with tcp1 dds transport TCPv4 Description send max wait sec Controls the maximum time in seconds the low level sendto function is allowed to block the caller thread when the TCP send buffer becomes full If the bandwidth used by the transport is limited and the sender thread tries to push data faster than the OS can handle the low level sendto function will block the caller until there is some room available in the queue Limiting this delay eliminates the pos sibility of deadlock and increases the response time of the internal DDS thread This property affects both CONTROL and DATA streams It only affects SYNCHRO NOUS send operations Asynchronous sends never block a send operation For synchronous send calls this property limits the time the DDS sender thread can block for a full send bu
43. in the AutoRouteStatusSet data type Table 6 10 AutoRouteStatusSet Member Name Description i Key field routing_service_name n E The routing service name assigned with appname Key field domain route name i The domain route name 6 20 6 3 Monitoring Status Table 6 10 AutoRouteStatusSet name Member Name Description Key field session name The session name Key field The auto route name The auto route name is configured using the name attribute in the auto topic route or auto route tags input samples per s Statistic variable that provides information about the input samples per second across routes Input samples refer to the samples that are taken by the session from the auto routes s StreamReaders input bytes per s Statistic variable that provides information about the input bytes per second across routes Input bytes refer to the bytes that are taken by the session from the auto routes s Stream Readers These bytes only refer to the serialized samples The protocol headers UDP RTPS are not included output samples per s output bytes per s Statistic variable that provides information about the output samples per second across routes Output samples refer to the samples that are published out by the session thread using the auto route s StreamWriters Statistic variable that provides information about the output bytes per secon
44. input connection will use types discovered in the output connection and vice versa for the creation of StreamWriters and route types StreamReaders in the route Dor1 See Discovering Types Section 2 4 6 3 Default false Sets a data transformation to be applied for every data sample see lt t ansformation Data Transformation Section 2 4 6 5 oori Topic Route Tags v Number Tags within Description of Tags topic route Allowed Configures remote monitoring for the topic route See Monitoring entity monitoring Section 2 4 4 and Chapter 6 Monitoring Routing Service from a 0or 1 Remote Location Indicates whether or not filter propagation is enabled When set to true the StreamReader s filter will be automatically set as the union of all the filters of the DataReaders matching the route s filter propagation Oor1 StreamWriter For more information see Chapter 9 Propagating Con tent Filters Default false input Defines the topic route s input topic See Table 2 13 1 required output Defines the topic route s output topic See Table 2 13 1 required Indicates whether or not disposed samples NOT ALIVE DISPOSE must be propagated by the topic route i f 1 lt propagate_dispose gt This action may be overwritten by the execution of a transformation Her Default true Indicates whether or not NOT ALIVE NO WRITERS samples must be propagated by the topic rout
45. is longer than XML URL MAX LENCGTH in the IDL file you will have to split the string and send several samples setting the is final field to false in all but the last sample Likewise the get command may generate a response longer than RESPONSE MAX LENGTH in the IDL file that will be received as several samples You will have to concatenate the mes sages from each one of the samples until a sample with the is final field set to true is received This sample is the last sample of the response Example 1 The following example shows how to send a command to update the Deadline QoS policy for a topic route s DataReader 5 8 5 3 Accessing Routing Service from a Connext Application Create entities participant publisher topic datawriter 1 RTI_RoutingService CommandRequest cmdRequest RTI RoutingService CommandRequestTypeSupport create data By specifying an unique ID for this command you will be able to identify its response later on cmdRequest gt id host host ID cmdRequest gt id app process ID cmdRequest gt id invocation invocationCounter Send this command to a routing service called MyRouter strcpy cmdRequest target router MyRouter The command type is update cmdRequest command d RTI ROUTING SERVICE COMMAND UPDATE Specify entity name to update and the XML code to define the new configuration strcpy cmdRequest command u entity
46. library Name SimpleFileAdapter Location C adapters v Browse Solution Mame SimpleFileAdapter Create directory For solution coca 3 Select Application Settings and choose DLL Click Finish Win32 Application Wizard SimpleFileAdapter Application Settings Overview Application type Add common header files for Application Settings Windows application Mar Console application F mc DLL C Static library Additional options IV Empty project Export symbols VV precompiled header lt Previous Next gt L Finish Cancel 4 Create a new file called SimpleFileAdapter c with the following content This file will contain the adapter implementation BORK RR RK KK RK KK KR ck kk ke KK RK k k SA Simple File Adapter BRK KR RK KK RR KK KR RK KK KK KR SSA 8 15 8 3 Creating New Adapters include lt stdio h gt include lt string h gt ifdef RTI_WIN32 include lt process h gt delse include lt pthread h gt Hendif include ndds ndds_c h include routingservice routingservice adapter h ifdef RTI_WIN32 Disable strtok fopen warnings pragma warning disable 4996 define DllExport X declspec dllexport Helse define D11Export Hendif Seabee is eee a re see eee Se eee Se Seek eee eee eee eee SS Simple File Adapter Connection FE P M R E A E A E E
47. long long count float mean float minimum float maximum float std_dev struct StatisticVariable StatisticMetric publication period metrics sequence lt StatisticMetrics MAX HISTORICAL METRICS gt historical_metrics The count is the sum of all the values received during the time frame For example in the case of input_sample_per_s and output_sample_p_s count is the number of samples received during the time frame For latency count is the sum of all the latency times for the samples received during the time frame If status publication is enabled see Section 2 4 4 Routing Service always publishes the statistics corresponding to the time between two status publications publication_period_metrics You can also select additional windows on a per entity basis using the tag lt historical_statistics gt see Section 2 4 4 The sequence historical_metrics in StatisticVariable contains values correspond ing to the windows that have been enabled 1 5 sec metrics correspond to activity in the last five seconds 1 1 min metrics correspond to activity in the last minute 1 5 min metrics correspond to activity in the last five minutes 1 1 hour metrics correspond to activity in the last hour L Up time metrics correspond to activity since the entity was enabled Each window has a field called period ms that identifies its size in milliseconds For the publication period metrics this field contains the publication p
48. of Tags Allowed lt administration gt Enables and configures remote administration See Administration Section 2 4 3 and Chapter 5 Administering Routing Service from a Remote Location Oorl lt annotation gt Contains a lt documentation gt tag that can be used to provide a routing service description This description will show up when you run Rout ing Service without the cfgName command line option Oorl lt domain_route gt Defines a mapping between two data domains See Section 2 4 2 1 or more required lt entity_monitoring gt Enables and configures remote monitoring for the routing service entity Oorl lt jvm gt Configures the Java JVM used to load and run Java adapters such as the JMS Adapter For example lt jvm gt class path lt element gt SocketAdapter jar lt element gt lt class_path gt lt options gt lt element gt Xms32m lt element gt lt element gt Xmx128m lt element gt lt options gt jvm The class path for the Java adapters can be set using either the class path tag or by setting the CLASSPATH environment variable Routing Service will always add Routing Service executable loca tion gt class rtiroutingservicesdk jar and Routing Service execut able location gt class dds jar at the end of the user defined class path You can use the options tag to specify options for the JVM such as the initial and maximum Ja
49. route name Routel gt lt route gt lt session gt lt domain_route gt routing service gt lt dds gt 2 19 2 4 XML Tags for Configuring Routing Service Sessions that bridge domains will create a Publisher and a Subscriber in the participants participant_1 or participant_2 associated with the domains Table 2 9 lists the tags allowed within a lt session gt tag Table 2 9 Session Tags iin Number pide a Description of Tags Allowed Defines a general route based on type and stream filters See Auto Routes Sec auto route 0 or more tion 2 4 7 auto topic Defines a general topic route based on type and topic filters See Auto Routes 0 or more route Section 2 4 7 Enables and configures remote monitoring for the session See Monitoring monitoring Section 2 4 4 and Chapter 6 Monitoring Routing Service from a Remote 0or1 Location Sequence of name value string pairs that can be used to configure certain parameters of the session For example property value element property lt name gt com rti socket timeout lt name gt Oor1 lt value gt 1 lt value gt lt element gt lt value gt lt property gt These properties are only used in non DDS domains Only applicable to Connext Sets the QoS associated with the session Publishers There is one Publisher per participant publisher E qos The contents of this tag are sp
50. service gt lt dds gt Table 2 3 lists the tags allowed within a lt domain_route gt tag Notice that most of these tags are required Table 2 4 lists the tags allowed within lt connection_1 gt and lt connection_2 gt tags 2 9 2 4 XML Tags for Configuring Routing Service Table 2 5 lists the tags allowed within lt participant_1 gt and lt participant_2 gt tags Notice that the lt domain_id gt tag is required Table 2 3 Domain Route Tags v Number of Tags within T Description Tags lt domain_route gt Allowed i Applicable to non DDS domains connection 1 1 required Configures the first connection See Table 2 4 Applicable to non DDS domains connection 2 1 required Configures the second connection See Table 2 4 Enables and configures remote monitoring for the domain route See Monitoring Section 2 4 4 OPE entity monitoring m Only applicable to DDS domains participant 1 1 required Configures the first participant See Table 2 5 un Only applicable to DDS domains participant 2 NN 1 required Configures the second participant See Table 2 5 Defines a single threaded context in which data is routed according 1 or more lt session gt to specified routes See Session Section 2 4 5 required Table 2 4 Connection Tags TET Number Tags within c 4 Description of Tags lt connection_1 2 gt Allowed
51. swap memory kb long host uptime Table 6 6 describes the fields in the RoutingServiceStatusSet data type Table 6 6 RoutingServiceStatusSet Field Name Description name Key field Name of the routing service instance The name associated with the Routing Service instance can be assigned explicitly by using the appName command line parameter If appName is not used the routing service tag name provided with cfgName is used If you use the iden tifyExecution command line parameter the host name and the process ID are appended to the name For example RTI_RoutingService_myhost_1234 cpu_usage_percentage Statistic variable that provides the percentage of CPU usage of the Routing Service process over different time windows This variable is only supported on Windows and Linux systems physical_memory_kb Statistic variable that provides the physical memory utilization of the Routing Ser vice process This variable is only supported on Windows and Linux systems total_memory_kb Statistic variable that provides the virtual memory utilization of the Routing Service process This variable is only supported on Windows and Linux systems uptime Contains the time elapsed since the Routing Service process started running This value is only supported on Windows and Linux systems host_cpu_usage_percentage Statistic variable that provides the global percentage of CPU usage on
52. tag stream name inside route input r Input registered name input A registered type The input registered name is configured using the tag Game y u registered type name inside topic route input route dds input or route input Index of the input connection or participant 1 or 2 input The value of this field is used to determine whether the input of this route is connection the domain route s connection 1 participant 1 or the connection 2 participant 2 input Indicates when the StreamReader is created in the input creation mode The input creation mode is configured using the tag creation mode i t i A i od Indicates whether or not the StreamReader associated with a route is created Contains the configuration of the route s input that is specific to either the DDS adapter or a generic adapter input When a generic input is defined lt route gt lt input gt then the union discrimi nator is RTI ROUTING SERVICE GENERIC ADAPTER KIND if it is a DDS input topic route input or route dds input then the union discriminator is RTI ROUTING SERVICE DDS ADAPTER KIND 6 8 6 2 Monitoring Configuration Data Table 6 4 RouteData Field Name Description input pa eg DDS input only Domain ID of the input participant domain_id ee do DDS input only Unique identifier for the DataReader adapter data dus The value of t
53. the fly changing topic names type defini tions QoS etc seamlessly bridging different generations of topic definitions L Routing Service provides features for development integration and testing Multiple sites can each locally test and integrate their core application expose selected topics of data and accept data from remote sites to test integration connectivity topic compatibil ity and specific use cases 1 It connects remotely to live deployed systems so you can perform live data analytics fault condition analysis and data verification 1 RTI Routing Service Adapter SDK allows you to quickly build and deploy bridges to integrate DDS and non DDS systems This can be done in a fraction of the time required to develop completely custom solutions Bridges automatically inherit advanced DDS capabilities including automatic discovery of applications data transfor mation and filtering data lifecycle management and support across operating systems programming languages and network transports RTI Routing Service Adapter SDK offers an out of the box solution for interfacing with third party protocols and technology It includes prebuilt adapters that can be used out of the box to interface with third party Java Message Service JMS providers or legacy code written to the network socket API Adapters include source code so they can be eas ily modified to meet application specific requirements or serve as a template for quick cr
54. the host where Routing Service is running This variable is only supported on Windows and Linux systems host_free_memory_kb Statistic variable that provides the amount of free physical memory on the host where Routing Service is running This variable is only supported on Windows and Linux systems host_total_memory_kb Contains the total memory of the host where Routing Service is running This vari able is only supported on Linux systems host_free_swap_memory_kb Statistic variable that provides the amount of free swap memory on the host where Routing Service is running This value is only supported on Linux systems 6 16 6 3 Monitoring Status Table 6 6 RoutingServiceStatusSet Field Name Description host_total_swap_memory_kb Contains the total swap memory of the host on which Routing Service is running This value is only supported on Linux systems host_uptime Contains the time elapsed since the host on which Routing Service is running started running This value is only supported on Windows and Linux systems 6 3 3 Table 6 7 Domain Route Status The topic that publishes domain route status is called rti routing_service monitoring domain_route_status_set The domain route status aggregates the statistics of the routes contained in it the mean of the means in the routes the absolute maximum and minimum across routes the mean of the stan dard deviatio
55. the written samples on the console lt route name route gt lt output gt lt stream_name gt HelloWorld lt stream_name gt registered type name gt TextLine lt registered type name gt lt property gt lt value gt lt element gt name print to _stdout lt name gt lt value gt 1 lt value gt lt element gt lt value gt lt property gt lt output gt lt route gt In the above example the output StreamWriter will store the lines provided by Routing Service on a file called HelloWorld txt It will also print the lines on the screen Insert the following code in the Simple File Adapter StreamWriter section of SimpleFil eAdapter c Create a file called SimpleFileAdapterStreamWriter java under Adapter directory gt routing service adapter simplefile Insert the following content BRK KK KK RK KK KKK KK KK e k k KKK KR RO KR KR SA Simple File Adapter Stream Writer BRK KK KK KK KK KKK k k k k k k k k KK KKK SSA package routingservice adapter simplefile import java io File import java io FileWriter import java io BufferedWriter import java io IOException import java util List import java util ListIterator import java util Properties import com rti dds dynamicdata DynamicData import com rti routingservice adapter StreamWriter import com rti routingservice adapter infrastructure AdapterException import com rti routingservice adapter infrastructure StreamInfo public cla
56. 1 is by statically configuring the filter see Chapter 2 Configuring Routing Service in the Routing Services StreamReaders This method has two main disadvantages 1 It requires knowing beforehand the data set subscribed by the user DataReaders 9 2 9 2 Filter Propagation Behavior 2 The filters in the StreamReaders are not automatically updated based on changes to the filters in the user DataReaders This may affect not only bandwidth utilization but also correctness For example a user DataReader may not receive a sample because it has been filtered out by one of the StreamReaders Filter propagation can address the previous issues by dynamically updating the StreamReaders filters The composed filter associated with a StreamReader in a route is built by aggregating the filter information associated with all DataReaders that match the route s StreamWriter as shown in Figure 9 3 Figure 9 3 Filter Propagation through Routing Service 9 2 1 2 Communication direction P Kg b H P s E 1 A A pd Filter propagation direction The composed filter CF is the union of the matching DataReaders filters and it allows passing any sample that passes at least one of the DataReader filters CF F4 U F gt TES FN For the SQL filter the union operator is OR Filter propagation occurs within a route as follows The route s output StreamWriter gathe
57. 1 3 Chapter 2 Configuring Routing Service This document describes how to configure Routing Service To see installation instructions or to walk through some simple examples please see the Getting Started Guide When you start Routing Service you can specify a configuration file in XML format it is not required In that file you can set properties that control the behavior of the service This chapter describes how to write a configuration file This chapter describes LJ Terms to Know Section 2 1 I How to Load the XML Configuration Section 2 2 1 XML Syntax and Validation Section 2 3 LI XML Tags for Configuring Routing Service Section 2 4 a Enabling and Disabling Routing Service Entities Section 2 5 1 Enabling RTI Distributed Logger in Routing Service Section 2 6 L Support for Extensible Types Section 2 7 2 1 Terms to Know Before learning how to configure Routing Service you should become familiar with a few key terms and concepts 1 A routing service entity refers to an execution of Routing Service 1 A domain route defines a two way mapping between two data domains For example a domain route could define a mapping between two different domains or between a domain and a JMS provider s network 21 A session defines a single threaded context for routes Data cannot be read and written from two routes in the session concurrently 1 A route defines a one way mapping between an input stream in one d
58. 4 Description recv socket buffer size Size in bytes of the receive buffer of a socket used for receiving On most operating systems setsockopt will be called to set the RECVBUF to the value of this parameter This value must be greater than or equal to parent message size max or 1 The maximum value is operating system dependent Default 1 setsockopt or equivalent will not be called to size the receive buffer of the socket ignore loopback interface Prevents the transport plugin from using the IP loopback interface This property is ignored when parent classid is NDDS TRANSPORT CLASSID TCPV4 WAN or NDDS TRANSPORT CLASSID TLSV4 WAN Two values are allowed 0 Enable local traffic via this plugin The plugin will use and report the IP loopback interface only if there are no other network interfaces NICs up on the system 1 Disable local traffic via this plugin This means do not use the IP loopback inter face even if no NICs are discovered This setting is useful when you want applica tions running on the same node to use a more efficient plugin like shared memory instead of the IP loopback Default 1 ignore nonrunning interfaces Prevents the transport plugin from using a network interface that is not reported as RUNNING by the operating system The transport checks the flags reported by the operating system for each network inter face upon initialization An interface which i
59. DL definition of the data type is struct SessionStatusSet string lt ENTITY NAME MAX LENGTH routing service name key string lt ENTITY NAME MAX LENGTH domain route name key string lt ENTITY NAME MAX LENGTH name key StatisticVariable input samples per s StatisticVariable input bytes per s StatisticVariable output samples per s StatisticVariable output bytes per s StatisticVariable latency s H Table 6 8 describes the fields in the SessionStatusSet data type Table 6 8 SessionStatusSet Field Name Description Y Key field routing service name B The routing service name assigned with CappName Key field domain route name The domain route name Key field name The session name The domain route name is configured using the name attribute in the lt session gt tag input_samples_per_s Statistic variable that provides information about the input samples per second across routes Input samples refer to the samples that are taken by the session from the routes s Stream Readers 6 18 6 3 Monitoring Status Table 6 8 SessionStatusSet Field Name Description input_bytes_per_s Statistic variable that provides information about the input bytes per second across routes Input bytes refer to the bytes that are taken by the sessions from the routes s StreamRead ers These bytes only refer to the serialized samples The protocol headers UDP RTPS are not include
60. E N AEN VENEN EEE ENT TE EEEE Simple File Adapter StreamReader See oo Se oe eee y eet ee ee sate eee oS Se Sate Selo SSS cla este te eee A Se Se Se Se Simple File Adapter StreamWriter San Soa ete tee ae ease eee he Oe ole m mme ee m mm mmt eee Simple File Adapter Adapter rr an See a ia iaa e is o e e eee eee eee ee eee ie 2 Entry point to the adapter plugin El D11Export struct RTI RoutingServiceAdapterPlugin SimpleFileAdapter create const struct RTI RoutingServiceProperties properties RTI RoutingServiceEnvironment env return NULL 8 16 8 3 Creating New Adapters 5 Add the new file to the project SimpleFileAdapter SimpleFileAdapter Microsoft Visual Studio BEE File Edit View Project Build Debug Tools Test findow Help H H 4 Gago C B B P Debug y Win32 Al processeds Eg T X Ww O 9gu amp a lution Explorer 5 SimpleFileAdapter c x fa A L iacta Scope eq Solution SimpleFileAdapter 1 proje El PRARARAAEREARARARERARERRERAREREREARAREREREARERARERERERRARERERERERE E EN simpleFileAdapter MI Header Files Simple File Adapter EM Resource Files AAAA L ARRE ARENA ARE RARA ERA EA AERA E REAR RARER EERE AREA ARREARS E Ey Source Files 4 SimpleFileAdapter c include lt stdio h g
61. IBRARY PATH LD_LIBRARY_PATH local java jdk1 7 0 jre lib i386 client To start Routing Service enter cd lt installation directory for Routing Service gt scripts rtiroutingservice options Example cd lt installation directory for Routing Service gt scripts rtiroutingservice cfgFile example shapes topic bridge xml cfgName example Table 3 1 describes the command line options Stopping Routing Service To stop Routing Service press Ctrl c Routing Service will perform a clean shutdown 1 See lt Connext installation directory ndds version doc pdf RTI CoreLibrariesAndUtilities ReleaseNotes pdf 3 1 Stopping Routing Service Table 3 1 RTI Routing Service Command line Options Option Description appName lt name gt Assigns a name to the execution of the Routing Service Remote commands and status information will refer to the routing ser vice using this name See the Routing Service User s Manual for more information In addition the name of DomainParticipants created by Routing Ser vice will be based on this name Default The name given with cfgName if present otherwise it is RII Routing Service cfgFile name Specifies a configuration file to be loaded See How to Load the XML Configuration Section 2 2 cfgName name Specifies a configuration name Routing Service will look for a matching lt routing_service gt tag in the configura
62. ID property parent classid to be one of the following values NDDS_TRANSPORT_CLASSID_TLSV4_LAN NDDS_TRANSPORT_CLASSID_TLSV4_WAN 1 Set at least a certificate of authority through either the tls verify ca_file or tls ver ify ca_path properties and the certificate identity through either the tls iden tity certificate_chain or tls identity certificate_chain_file properties L Make sure to use tlsv4_lan or tlsv4_wan in the initial peers list as the prefix for all des tination addresses To see the differences between a WAN scenario and the same scenario with TLS enabled you can compare the two example configuration files 1 shapes tcp transport xml I shapes tcp transport tls xml 7 4 7 2 Configuring the TCP Transport 7 2 7 2 1 7 2 2 Configuring the TCP Transport The TCP transport is distributed as a shared library in Routing Service installation directory bin lt architecture gt The library is called nddstransporttcp dll on Windows and libnddstrans porttcp so on UNIX based systems For an example on how to use and configure the TCP transport with Routing Service see Example 8 Using the TCP Transport with Routing Service Section 4 8 in the Getting Started Guide As seen in the example you can configure the properties of the transport in the XML configura tion file using the appropriate name value pairs in the DomainParticipant s PropertyQoSPolicy This will cause Routing Service to dyna
63. In the previous example the domain route overwrites the status publication period to 4 seconds and inherits the statistics sampling period Table 2 8 Entity Monitoring Tags Number Tags within ON lt entity_monitoring gt Description E ne Enables disables remote monitoring for a given entity enabled If general monitoring is disabled this value is ignored Oor1 Default value true Enables or disables the publication of statistics calculated within fixed time windows By default Routing Service only publishes the statistics corresponding to the window between two status publications By using this tag you can get the following additional windows J 5 seconds 1 1 minute 5 minutes 1 1 hour Up time since the entity was enabled historical statistics Oor1 For example historical statistics five second true five second one minute gt true lt one minute five minute gt false lt five_minute gt one hour true one hour up time false up time historical statistics If a window is not present inside the tag historical statistics it is considered disabled If this tag is not defined historical statistics are inherited from the gen eral monitoring settings 2 18 2 4 XML Tags for Configuring Routing Service Table 2 8 2 4 5 Entity Monitoring Tags Tags within lt entity_monitoring gt Description Number of Tags A
64. JVM creation and configuration with the rout ing service Sequence of name value string pairs that can be used to configure the parameters of the adapter For example property value lt property gt lt element gt 0or1 lt name gt username lt name gt lt value gt myusername lt value gt lt element gt lt value gt lt property gt 8 2 Adapter API And Entity Model 3 Session A Session is a concurrency unit within a connection that has an associated set of StreamReaders and StreamWriters Access to the StreamReaders and StreamWriters in the same Session is serialized by Routing Service two StreamReaders StreamWriters cannot be accessed concurrently In the built in DDS adapter a Session is mapped to a Publisher Subscriber pair In an XML file Sessions are associated with the tag lt session gt see Section 2 4 5 See Table 8 5 Session Operations on page 8 6 4 StreamReader A StreamReader provides a way to read samples of a specific type froma data domain In the built in DDS adapter a StreamReader is mapped to a DataReader In an XML file StreamReaders are associated with the tag lt input gt within lt route gt or lt auto_route gt see Section 2 4 6 See Table 8 6 StreamReader Operations on page 8 7 5 StreamWriter A StreamWriter provides a way to write samples of a specific type in a data domain In the built in DDS adapter a StreamWriter is mapped to
65. Listener s on_data_available callback operation to wake up the session thread associated with it After that the session thread will invoke the StreamReader s read operation to get the new data Stream Reader on_data_available Session Thread Wait Read Write The figure to the right describes how the TE session thread reads samples from a StreamReader E y 8 3 Creating New Adapters Routing Service provides an adapter SDK in C and Java to support the creation of new adapter plugins The Routing Service Adapter SDK is distributed as a separate component that must be installed over an existing installation of Routing Service For more information see the Routing Service Adapter SDK SDK Installation Guide 8 3 1 Adapter SDK Components After installing Routing Service Adapter SDK the components in Table 8 8 will be available in the Routing Service root folder Table 8 8 Adapter SDK Components Component Description Release Notes and Installation Guide Adapter SDK release notes and installation guide lt Routing Service home gt doc pdf Adapter SDK Programming Guide Chapter 8 in the Routing Service User s Manual this chapter API Specification C and Java API specification in HTML and PDF format The C API specification describes the Adapter and Transformation API see Chapter 4 The Java API specification describes the Adapter API lt Routing Service home
66. MONOBJS c cc c ld flags shared o e S LIBS objs ARCH 0 c c cc c cc flags o e DEFINES INCLUDES c lt Here is how we create those subdirectories automatically dir Gecho Checking directory Gif d then echo Making directory mkdir p fi clean rm rf objs rm rf lib The above makefile assumes that the architecture is i86Linux2 6gcc4 4 5 If you are build ing for a different architecture you can use the above makefile as an example 8 19 8 3 Creating New Adapters 4 Create a new file called SimpleFileAdapter c with the following content This file will contain the adapter implementation BORK RRR RK KR KR KR KK KR KK KR RK KK KR SA Simple File Adapter BRK KR KK KKK RR e RK KR RK KR KR RK KR SA include lt stdio h gt include lt string h gt ifdef RTI WIN32 include lt process h gt else include lt pthread h gt endif include ndds ndds_c h include routingservice routingservice adapter h ifdef RTI_WIN32 Disable strtok fopen warnings Hpragma warning disable 4996 define DllExport _ declspec dllexport else define DllExport Hendif pm Simple File Adapter Connection pm Simple File Adapter StreamReader i Simple File A
67. OME scripts rtiroutingservice cfgFile simple file adapter xml cfgName file to file 6 On the screen you will see RTI Routing Service lt version gt started with name file to file Hello World 1 Hello World 2 Hello World 3 Hello World 4 Hello World 5 Hello World 6 Hello World 7 Hello World 8 Hello World 9 Hello World 10 7 Verify that a file called HelloWorld txt has been generated into the output directory The content of this file should be identical to the content of the same file in the input direc tory 8 3 7 Debugging Java Adapters When you develop a custom adapter you will need to debug it and test it This section describes the tools and APIs that you have available to debug and detect problems in Routing Service adapters written in Java 8 54 8 3 Creating New Adapters 8 3 7 1 The first debugging capability is provided by the Routing Service Adapter SDK The adapter SDK provides a way to access the verbosity level of Routing Service as a property called rti routingser vice verbosity which can be obtained from the properties passed to the adapter constructor It is highly recommended that as part of the adapter implementation you instrument the code by adding status messages that will be printed with the INFO and DEBUG verbosity levels This level of instrumentation will help you to capture run time information for troubleshooting The second debugging capability is provided by third part
68. ONE lt mask gt lt transport_builtin gt lt property gt lt value gt lt element gt lt name gt dds transport load_plugins lt name gt lt value gt dds transport TCPv4 tcpl lt value gt lt element gt lt element gt lt name gt dds transport TCPv4 tcpl library name lt value gt libnddstransporttcp so lt value gt lt element gt lt element gt lt name gt dds transport TCPv4 tcpl create function lt name gt lt value gt NDDS_Transport_TCPv4_create lt value gt lt element gt lt element gt lt name gt dds transport TCPv4 tcpl parent classid lt name gt lt value gt NDDS_TRANSPORT_CLASSID_TCPV4_WAN lt value gt lt element gt 7 2 Configuring the TCP Transport lt element gt lt name gt dds transport TCPv4 tcpl public address name lt value gt 18 181 0 31 8400 lt value gt lt element gt lt element gt lt name gt dds transport TCPv4 tcpl server bind port lt name gt lt value gt 7400 lt value gt lt element gt lt value gt lt property gt lt participant_qos gt lt participant_2 gt lt domain_route gt routing service dds 7 2 3 TCP ILS Transport Properties Table 7 1 describes the TCP and TLS transport properties Table 7 1 TCP TLS Transport Properties over LAN or WAN NDDS Transport TCPv4 Property t Property Name prefix with dds transport TCPv4 tcp1 Description Required dds transport load_plugins Not
69. OR_ ROUTE_MATCH At least one of the conditions must be true Route Destruction The same rules that are applied to create the route StreamWriter and StreamReader also apply to their destruction When the condition that triggered the creation of that entity becomes false the entity is destroyed Note that IMMEDIATE will never become false 2 28 2 4 XML Tags for Configuring Routing Service 2 4 6 5 For example if the creation mode of a topic route s input tag is ON DOMAIN MATCH when all the matching user DataWriters in the input domain are deleted the topic route s DataReader is deleted When a remote application ends abruptly or doesn t delete its DDS entities explicitly Routing Service will only detect the loss of matching DataReaders and DataWriters after the discovery_config participant_liveliness_lease_duration in the DomainRoute s participant QoS expires Example 1 In this example data is routed as soon as a user DataWriter is publishing it on the first domain lt topic_route gt lt input participant 1 gt creation mode ON DOMAIN MATCH lt creation_mode gt input output creation mode ON ROUTE MATCH creation mode lt output gt lt topic_route gt Example 2 In this example data is not routed until a user DataWriter is publishing and a user DataReader is already expecting it lt topic_route gt lt input participant 1 gt lt creation_mode gt ON DOMAIN AND ROUTE MATCH l
70. P address space and use NAT Network Address Translation to communicate with other networks To overcome these issues Routing Service is distributed with a TCP transport that is NAT friendly The transport can be configured via XML using the PropertyQosPolicy of the Routing Service s participants Figure 7 1 shows a typical scenario where two Routing Services are used to bridge two Connext applications running in two different LANs The next sections explain how to use and configure the TCP transport with Routing Service TCP Communication Scenarios The TCP transport distributed with Routing Service can be used to address multiple communica tion scenarios that go from simple communication within a single LAN to complex communica tion scenarios across LANs where NATs and firewalls may be involved Communication Within a Single LAN TCP transport can be used as an alternative to UDPv4 to communicate with Connext applica tions running inside the same LAN Figure 7 2 shows how to configure the TCP transport in this scenario parent classid transport_mode and server_bind_port are transport properties configured using the PropertyQosPolicy of the participant 7 1 7 1 TCP Communication Scenarios Figure 7 1 WAN Communication Using TCP Transport Connext application 1 Connext application 2 LAN1 Participant2 UDPv4 Transport articipant 1 Participant 2 UDPv4 TCPv4 Transport Transport T Tran
71. RBOSITY DEBUG printf CALL SimpleFileAdapterConnection delete stream reader Wn reader run 0 ifdef RTI WIN32 WaitForSingleObject reader gt thread INFINITE else pthread_join reader gt thread amp value endif if reader gt fHandle fclose reader fHandle if reader sample 0 DDS DynamicData delete reader sample 0 free reader Creates a StreamReader t RTI RoutingServiceStreamReader SimpleFileAdapterConnection create stream reader RTI RoutingServiceConnection connection RTI RoutingServiceSession session const struct RTI RoutingServiceStreamInfo stream info const struct RTI RoutingServiceProperties properties const struct RTI RoutingServiceStreamReaderListener listener RTI RoutingServiceEnvironment env const char readPeriodStr unsigned int readPeriod char file 8 27 8 3 Creating New Adapters struct SimpleFileAdapterConnection self struct SimpleFileAdapterConnection connection struct SimpleFileAdapterStreamReader reader NULL struct DDS DynamicDataProperty t dynamicDataProps DDS DynamicDataProperty t INITIALIZER int error 0 ifndef RTI WIN32 pthread attr t threadAttr endif int verbosity verbosity RTI RoutingServiceEnvironment get verbosity env if verbosity RTI ROUTING SERVICE VERBOSITY DEBUG printf CALL SimpleFileAdapterConnection create stream reader Wn Create StreamReader reader calloc
72. RTI Routing Service User s Manual Version 5 1 0 f t Your systems Working as one 2009 2013 Real Time Innovations Inc All rights reserved Printed in U S A First printing December 2013 Trademarks Real Time Innovations RTI and Connext are trademarks or registered trademarks of Real Time Innovations Inc All other trademarks used in this document are the property of their respective owners Copy and Use Restrictions No part of this publication may be reproduced stored in a retrieval system or transmitted in any form including electronic mechanical photocopy and facsimile without the prior written permission of Real Time Innovations Inc The software described in this document is furnished under and subject to the RTI software license agreement The software may be used or copied only under the terms of the license agreement Technical Support Real Time Innovations Inc 232 E Java Drive Sunnyvale CA 94089 Phone 408 990 7444 Email support rti com Website https support rti com Contents 1 Welcome to RTI Routing Service 1 1 Available Documentation rsisi oei ieaiaia aede anaa a aa p aaa SATEEN ESR ai AE 1 3 2 Configuring Routing Service 21 Terms to KNOW eree eei eee ib e ii 2 1 2 2 How to Load the XML Configuration sse eene nennen nennen nennen nnne 2 2 29 XML Syntax and Validato sisirin r c ener tee tete le ne tee e a ea 2 3 2 4 XML Tags for Configuring Routing Service
73. SROUTINGSERVICEHOME S scripts rtiroutingservice cfgFile simple file adapter xml cfgName file to file You should see output like this Listening for transport dt_socket at address 1024 At this point the execution of Routing Service is suspended and waiting for a debugger to attach 8 55 8 3 Creating New Adapters 8 3 7 2 Debugging with JDB jdb is the command line debugger of Java This section is not intended to give complete cover age on all the jdb functionality and commands but rather to provide basic information on how to attach to the Routing Service JVM and start debugging For more information about JDB see the following web page http java sun com j2se 1 5 0 docs tooldocs windows jdb html 1 Ina separate shell window start jdb UNIX based systems cd opt adapters simplefile gt jdb sourcepath attach 1024 Windows systems gt cd c adapters SimpleFileAdapter gt jdb sourcepath attach 1024 2 Set breakpoints in the methods or classes that you would like to debug For example to set a breakpoint in the SimpleFileAdapter constructor enter the follow ing main 1 stop in routingservice adapter simplefile SimpleFileAdapter lt init gt 3 Resume the execution of Routing Service by entering main 1 cont You will see output similar to gt Set deferred breakpoint routingservice adapter simplefile SimpleFil eAdapter lt init gt Breakpoint hit thread main routingservice adapter s
74. TY NAME MAX LENGTH domain route name key string lt ENTITY NAME MAX LENGTH session name Gkey string lt ENTITY NAME MAX LENGTH name key string lt ENTITY NAME MAX LENGTH auto route name boolean propagate dispose boolean propagate unregister boolean publish with original info boolean publish with original timestamp boolean route types RouteInputData input RouteOutputData output sequence lt TransformationData MAX TRANSFORMATIONS gt transformations boolean paused Table 6 4 describes the fields in the RouteData topic data type Table 6 4 RouteData Field Name Description routing_service_name Key field The routing service name assigned with appName domain_route_name Key field The domain route name session_name Key field The session name 6 7 6 2 Monitoring Configuration Data Table 6 4 RouteData Field Name Description name Key field The route name which is configured using the name attribute in the lt route gt or lt topic_route gt tag auto_route_name If the route is contained in an auto route this field contains the auto route name Otherwise the field is initialized with the empty string propagate_dispose DDS topic routes only Indicates if the topic route propagates NOT_ALIVE_DISPOSE samples The propagation of NOT_ALIVE_DISPOSE samples is configured using the tag lt propagate_dispose g
75. The value of this field is used to determine whether the input of this auto route connection is the domain route s connection 1 participant 1 or the connection 2 partici pant 2 input Indicates when the StreamReader is created in the input The input creation mode is configured using the tag creation mode input adapter data Contains the configuration of the auto route s input that is specific to either the DDS adapter or a generic adapter When a generic input is defined auto route lt input gt the union discrimina tor is RTI ROUTING SERVICE GENERIC ADAPTER KIND if it is a DDS input auto topic route input or auto route dds input the union discriminator is RTI ROUTING SERVICE DDS ADAPTER KIND adapter data dds content filter expression input adapter data dds DDS input only Domain ID of the input participant domain id ione DDS input only Content filter expression associated with the content filter for input the topic route DataReader The expression is configured using the tag content filter expression inside topic route input or route dds input input adapter data generic property Not applicable for DDS input The properties used to configure this route s StreamReader specified with the tag lt property gt inside route input The configuration of the auto route output as contained in the tag output or allow stream
76. To enable remote monitoring you can use the lt monitoring gt tag see Section 2 4 4 or the remoteMonitoringDomainId command line parameter which enables remote monitoring and sets the domain ID for data publication For more information about the command line options see Section 3 1 in the Getting Started Guide When remote monitoring is enabled Routing Service creates L 1 DomainParticipant J 1 Publisher L 5 DataWriters for publishing configuration data one for each kind of entity L 5 DataWriters for publishing status one for each kind of entity The QoS values for these entities are described in Section 2 4 4 Monitoring Configuration Data Configuration data for Routing Service entities is published in entity data topics These topics are similar to the builtin topics DCPSParticipant DCPSPublication and DCPSSubscription that provide information about the configuration of remote DDS entities This configuration data is published when l An entity is created or enabled 1 An entity is disabled or destroyed a dispose message is published I The entity s configuration is modified using the remote command update see Section 5 2 12 1 The entity s configuration is modified due to certain events in Routing Service For exam ple discovery events may trigger the creation of StreamWriters and StreamReaders in a route The following sections describe the data available for each kind of Routing Service entity
77. TransformationData string lt ENTITY NAME MAX LENGTH gt plugin_ name sequence lt Property MAX PROPERTIES gt property struct RouteAdapterData sequence lt Property MAX PROPERTIES gt property ri struct RouteDdsInputData long domain id BuiltinTopicKey t datareader key String EXPRESSION MAX LENGTH content filter expression union RouteInputAdapterData switch AdapterKind case RTI ROUTING SERVICE DDS ADAPTER KIND RouteDdsInputData dds case RTI ROUTING SERVICE GENERIC ADAPTER KIND RouteAdapterData generic struct RouteDdsOutputData long domain id BuiltinTopicKey t datawriter key 6 6 6 2 Monitoring Configuration Data union RouteOutputAdapterData switch AdapterKind case RTI_ROUTING SERVICE DDS ADAPTER KIND RouteDdsOutputData dds case RTI ROUTING SERVICE GENERIC ADAPTER KIND RouteAdapterData generic struct RouteInputData string lt TOPIC NAME MAX LENGTH stream name string TYPE NAME MAX LENGTH registered type name long connection RouteCreationMode creation mode DDSEntityState state RouteInputAdapterData adapter data struct RouteOutputData string TOPIC NAME MAX LENGTH stream name string TYPE NAME MAX LENGTH registered type name RouteCreationMode creation mode DDSEntityState state RouteOutputAdapterData adapter data struct RouteData string lt ENTITY_NAME MAX LENGTH routing service name Gkey string lt ENTI
78. Type lt registered type name gt topic name Square topic name input 2 36 2 6 Enabling RTI Distributed Logger in Routing Service 2 6 2 7 lt output gt registered type name gt ShapeType lt registered type name gt topic name Circle c topic name output topic route lt session gt lt domain_route gt routing service gt lt dds gt When an entity is created disabled it can be enabled remotely using the commands enable Sec tion 5 2 5 and disable Section 5 2 4 A routing service can be created disabled by setting the attribute enabled to false or by using the noAutoEnable command line option The command line parameter takes precedence over the XML attribute value Enabling RTI Distributed Logger in Routing Service Routing Service provides integrated support for RTI Distributed Logger When you enable Distributed Logger Routing Service will publish its log messages to Connext Then you can use RTI Monitor to visualize the log message data Since the data is provided in a topic you can also use rtiddsspy or even write your own visualization tool To enable Distributed Logger modify the Routing Service XML configuration file In the lt adminis tration gt section add the lt distributed_logger gt tag as shown in the example below lt routing service name default gt lt administration gt distributed logger gt lt enabled gt true lt enabled gt lt distribu
79. a DataWriter In an XML file StreamWriters are associated with the tag lt output gt within lt route gt or lt auto_route gt see Section 2 4 6 See Table 8 7 StreamWriter Operations on page 8 7 Figure 8 1 describes the adapter class model Figure 8 1 Adapter Class Model 8 4 8 2 Adapter API And Entity Model Table 8 3 Adapter Operations Operation Description create_connection Creates a new connection Connection objects are created when the domain routes that contain them are enabled Implementation of this API is required delete_connection Deletes a previously created connection Connection objects are deleted when the domain routes that contain them are disabled Implementation of this API is required getVersion Returns the Adapter s version This method is only available in Java In C the version of the adapter is set on a member called plugin_version in the plugin structure RTI_RoutingServiceAdapterPlugin see Section 8 3 2 The version of the adapter is only used for logging purposes Implementation of this API is required Table 8 4 Connection Operations Operation Description connection_to_ string Returns the string representation of a connection for logging purposes Implementation of this API is optional If the API is not implemented Routing Service will use the fully qualified name of the adapter plugin create_session Cre
80. adapter infrastructure Version import java util Properties Simple file adapter public class SimpleFileAdapter implements Adapter String verbosity Entry point to the adapter public SimpleFileAdapter Properties props verbosity props getProperty rti routingservice verbosity if verbosity equals debug System out println CREATE getClass getName 7 public Connection createConnection String routingServiceName String routingServiceGroupName StreamReaderListener inputStreamDiscoveryListener StreamReaderListener outputStreamDiscoveryListener Properties properties throws AdapterException 1 c adapters SimpleFileAdapter for Windows systems or opt adapters simplefile for UNIX based systems 8 41 8 3 Creating New Adapters 8 3 6 5 if verbosity equals debug System out println CALL getClass getName createConnection return new SimpleFileAdapterConnection properties verbosity public void deleteConnection Connection connection throws AdapterException if verbosity equals debug System out println CALL getClass getName deleteConnection Returns the adapter version public Version getVersion return new Version 1 0 0 0 To create a SimpleFileAdapter object Routing Service will use the constructor SimpleFil eAdapter Properties props The props p
81. al_statistics gt it is considered disabled Historical statistics can be overwritten on a per entity basis Configures the DomainParticipant QoS for remote monitoring pe If the tag is not defined Routing Service will use the Connext defaults participant qos Oor1 with the following change resource limits type code max serialized length 4096 Configures the Publisher QoS for remote monitoring publisher qos If the tag is not defined Routing Service will use the Connext Oor1 defaults 2 16 2 4 XML Tags for Configuring Routing Service Table 2 7 2 4 4 1 Monitoring tags Number of Description Tags Allowed Tags within lt monitoring gt Specifies the frequency at which status statistics are gathered Statis tical variables such as latency are part of the entity status For exam ple statistics sampling period lt sec gt 1 lt sec gt lt nanosec gt 0 lt nanosec gt statistics sampling lt statistics sampling period 1 period 0 or The statistics period for a given entity should be smaller than the publication period If the tag is not defined the period is 1 second The statistics sampling period defined in routing service is inherited by all the entities inside routing service An entity can overwrite the period Specifies the frequency at which the status of an entity is published For example status publication period lt sec gt 3 lt
82. amWriter and StreamReader will be created as soon as the type ShapeType is discovered in either domain topic route route types true route types lt input participant 1 gt lt creation_mode gt IMMEDIATE lt creation_mode gt registered type name gt ShapeType lt registered_type name gt lt input gt lt output gt lt creation_mode gt IMMEDIATE lt creation_mode gt registered type name gt ShapeType lt registered_type name gt lt output gt lt topic_route gt 1 See lt Connext installation directory ndds version doc pdf RTI_CoreLibrariesAndUtilities_UsersManual pdf 2 27 2 4 XML Tags for Configuring Routing Service 2 4 6 4 Table 2 14 In this next example the StreamReader will be created only when the type ShapeType is discov ered in the input domain the StreamWriter will be created only when the type ShapeType is discovered in the output domain lt topic_route gt route types gt false lt route types input participant 1 gt creation mode gt IMMEDIATE lt creation_mode gt registered type name gt ShapeType lt registered type name gt input output creation mode IMMEDIATE creation mode registered type name gt ShapeType lt registered type name gt output topic route Creation Modes Controlling when StreamReaders and StreamWriters are Created The way a route creates its StreamReader and StreamWriter and starts reading and writing data
83. ame DDSSquaresToJMSSquares gt dds input participant 1 gt topic name Square topic name registered type name ShapeType registered type name gt dds input output stream name Square topic name registered type name ShapeType registered type name gt output lt route gt lt session gt lt domain_route gt routing service gt lt dds gt DDS inputs and outputs within a route are defined using the XML tags lt dds_input gt and lt dds_output gt Input and outputs from other data domains are defined using the tags lt input gt and lt output gt A topic route is a special kind of route that defines a mapping between an input topic on one domain and an output topic on another domain For example the fol lowing topic route will subscribe to topic Square on domain 54 and will republish those samples on domain 55 as samples of topic Circle lt dds gt lt routing service gt lt domain_route gt lt participant_1 gt lt domain_id gt 54 lt domain_id gt lt participant_1 gt lt participant_2 gt lt domain_id gt 55 lt domain_id gt lt participant_2 gt session name Sessionl1 gt lt topic route name SquaresToCircles gt lt input participant 1 gt topic name Square topic name gt registered type name ShapeType registered type name gt 2 22 2 4 XML Tags for Configuring Routing Service lt input gt lt output g
84. apters return new SimpleFileAdapterStreamReader listener streamInfo properties directory verbosity e public void deleteStreamReader StreamReader streamReader throws AdapterException if verbosity equals debug System out println CALL getClass getName deleteStreamReader SimpleFileAdapterStreamReader streamReader close public StreamWriter createStreamWriter Session session StreamInfo streamInfo Properties properties throws AdapterException if verbosity equals debug System out println CALL getClass getName createStreamWriter return new SimpleFileAdapterStreamWriter streamInfo properties directory verbosity public void deleteStreamWriter StreamWriter streamWriter throws AdapterException if verbosity equals debug System out println CALL getClass getName deleteStreamWriter SimpleFileAdapterStreamWriter streamWriter close public Properties getAttributes throws AdapterException throw new AdapterException 0 operation not supported El 8 3 Creating New Adapters 8 3 6 6 public void update Properties properties throws AdapterException Connection objects are configurable using properties name value pairs The properties are set using the lt property gt tag within lt connection_x gt For the SimpleFileAdapter example there
85. arameter is used to configure the adapter object Some of the values can be set from the XML configuration file using the tag lt property gt within lt java_adapter_plugin gt and other values are set by Routing Service One of the predefined values is rti routingservice verbosity This property provides information about the verbosity level used to run Routing Service see Section 8 3 5 3 Adapter objects are factories for Connection objects Implementing the Connection Class Connection objects provide access to data domains such as DDS domains or JMS network pro viders and they are configured using the XML tags lt connection_1 gt and lt connection_2 gt in a lt domain_route gt see Section 2 4 2 In the SimpleFileAdapter example the connection objects will provide access to a directory in your computer s file system The next step consists of implementing the Connection Java class Create a file called SimpleFileAdapterConnection java under Adapter directory gt routing service adapter simplefile Insert the following content BRK KKK KR KR KK KKK KR k e ke e k k KKK KR RRA k k k k k k k k k k k k AAA RARAS Simple File Adapter Connection EE SSA package routingservice adapter simplefile import java util Properties 1 c adapters SimpleFileAdapter for Windows systems or opt adapters simplefile for UNIX based systems 8 42 8 3 Creating New Adapters import com rti routingservice adapter Connec
86. are Created Section 2 4 6 4 Sequence of name value string pairs that can be used to configure certain parameters of the StreamReaders StreamWriters For example property value property elements 0or 1 lt name gt com rti socket port lt name gt lt value gt 16556 lt value gt lt element gt lt value gt lt property gt lt registered_type_ Sets the registered type name of this stream See Route Types Section 1 name gt 2 4 6 1 required lt stream_name gt Sets the stream name required Connext Input and Output Tags for a Route or Topic Route Tags within Tags within Number ropie Tower NS opie tou a 2E Description of Tags Allowed lt route gt lt dds_input gt lt route gt lt dds_output gt lt re gistered_type_name gt Sets the registered type name of this topic See 1 Route Types Section 2 4 6 1 required 1 lt topic_name gt Sets the topic name required Specifies when to create the DataReader DataWriter Default IMMEDIATE creation mode Oor1 ated Section 2 4 6 4 See Creation Modes Controlling when StreamReaders and StreamWriters are Cre 2 25 2 4 XML Tags for Configuring Routing Service Table 2 13 Connext Input and Output Tags for a Route or Topic Route 2 4 6 1 2 4 6 2 ea eed lonis pde ui Number and and Description of Tags route dds input route dds output Allowe
87. ata domains such as DDS or JMS The input samples are processed by the Routing Service engine and are passed along to custom transfor mations if they are defined Finally the transformed data is provided to the output adapters Routing Service Engine o k 3 2 S o lt 2 The adapter plugin API is used to create new adapters it is sup ported in C and Java The rest of this chapter describes L Adapter Usage and Configuration Section 8 1 LI Adapter API And Entity Model Section 8 2 1 Creating New Adapters Section 8 3 8 1 Adapter Usage and Configuration Adapter plugins must be registered within an adapter library in the XML configuration file For example lt xml version 1 0 gt dds adapter library name MyAdapterLibrary gt adapter plugin name MyCAdapterPlugin gt 8 1 8 2 Adapter API And Entity Model lt d11 gt mycadapter lt d11 gt create function gt MyCAdapterPlugin _create lt create function gt lt adapter_plugin gt java adapter plugin name MyJavaAdapter gt class name com rti adapters MyJavaAdapter class name gt java adapter plugin adapter library dds C adapters are registered using the tag adapter plugin Java adapters use the tag java adapter plugin Table 8 1 lists the tags allowed within adapter plugin Table 8 2 lists the tags allowed within java adapter plugin Once the adapter pl
88. ates a new session Connection session objects are created when the associated routing service sessions are enabled Implementation of this API is optional delete_session Deletes a previously created session Connection session objects are deleted when the routing service sessions that contain them are disabled Implementation of this API is optional create_ stream_reader Creates a new StreamReader within a routing service route This method is called when the route is enabled and the creation mode condition asso ciated with the lt input gt tag becomes true see Section 2 4 6 4 One of the parameters received by the create_stream_reader operation is the Stream ReaderListener The StreamReaderListener interface provides a callback which will be used by the adapter to notify Routing Service of the existence of new data Implementation of this API is required only when there are routes using the adapter to receive data delete_ stream_reader Deletes a previously created StreamReader This method is called when the route is disabled or when the creation mode condition associated with the lt input gt tag becomes false see Section 2 4 6 4 Implementation of this API is required only when there are routes using the adapter to receive data create_ stream_writer Creates a new StreamWriter within a routing service route This method is called when the route is enabled and the
89. ation Advanced Command Line Linker Manifest Tool XML Document Generator Browse Information Build Events Custom Build Step Additional Include Directories ahh or more directories to add to the include path use semi colon delimited list if more than one pati Cancel Apply e Add the following to Additional Include Directories 8 17 8 3 Creating New Adapters NDDSHOME include NDDSHOME include ndds ROUTINGSERVICEHOME include e Select Configuration Properties Linker General add the following to Additional Library Directories NDDSHOME 1lib i86Win32VS2008 ROUTINGSERVICEHOME bin i86Win32VS2008 e Select Configuration Properties Linker Input add the following to Additional Dependencies rtirsinfrastructure lib nddsc lib nddscore lib netapi32 lib advapi32 lib user32 lib WS2 32 1lib e In the Configuration combo box select Debug e Select Configuration Properties C C Preprocessor replace the contents of Pre processor Definitions with WIN32 WIN32 LEAN AND MEAN NDDS DLL VARIABLE RTI_WIN32 DEBUG e Inthe Configuration combo box select Release e Select Configuration Properties C C Preprocessor replace the contents of Pre processor Definitions with WIN32 WIN32 LEAN AND MEAN NDDS DLL VARIABLE RTI WIN32 NDEBUG e Click OK 7 In theSolution Configuration combo box select Release 6 SimpleFileAdapter Microsoft Visual Studio File Edit Vi
90. ation mode AutoRouteOutputAdapterData adapter data struct AutoRouteData string lt ENTITY NAME MAX LENGTH routing service name key string lt ENTITY NAME MAX LENGTH domain route name key string lt ENTITY NAME MAX LENGTH session name Gkey string lt ENTITY NAME MAX LENGTH name key boolean propagate dispose boolean propagate unregister boolean publish with original info boolean publish with original timestamp long enabled route count AutoRouteInputData input AutoRouteOutputData output boolean paused 2 Table 6 5 describes the fields in the AutoRouteData data type Auto topic route data samples are published when I The auto route is enabled 1 The auto route is disabled dispose sample I The auto route configuration is modified using the remote command update 6 11 6 2 Monitoring Configuration Data LJ A new route is created from the auto route Lj Monitoring is enabled via remote administration Table 6 5 AutoRouteData name Field Name Description Key field routing_service_name The routing service name assigned using appName i Key field domain_route_name The domain route name Key field session_name The session name Key field The auto route name which is configured using the name attribute in the lt auto_route gt or lt auto_topic_route gt tags propagate_dispose DDS auto_topic routes only Indicates if the topic rout
91. bosity RTI RoutingServiceEnvironment get verbosity env if verbosity RTI ROUTING SERVICE VERBOSITY DEBUG printf CALL SimpleFileAdapter delete connection Wn ds cx directory NULL free cx gt directory free cx Creates a connection RTI_RoutingServiceConnection SimpleFileAdapter create connection struct RTI_RoutingServiceAdapterPlugin adapter const char routing service name const char routing service group name const struct RTI RoutingServiceStreamReaderListener input disc listener const struct RTI RoutingServiceStreamReaderListener output disc listener const struct RTI RoutingServiceTypeInfo registeredTypes int registeredTypeCount const struct RTI RoutingServiceProperties properties RTI RoutingServiceEnvironment env 8 22 8 3 Creating New Adapters 8 3 3 6 const char directory struct SimpleFileAdapterConnection cx int verbosity verbosity RTI RoutingServiceEnvironment get verbosity env if verbosity RTI ROUTING SERVICE VERBOSITY DEBUG printf CALL SimpleFileAdapter create connectionin cx calloc 1 sizeof struct SimpleFileAdapterConnection if cx NULL RTI_RoutingServiceEnvironment_set_error env Memory allocation error return NULL directory RTI RoutingServiceProperties lookup property properties directory if directory NULL RTI RoutingServiceEnvironment set error env directory property i
92. cally if it exists The next locations are specific to Routing Service Routing Service executable location gt resource xml RTI_ROUTING_SERVICE xml This file contains the default Routing Service configuration it is loaded if it exists RTI_ROUTING_SERVICE xml defines a service that automatically routes all types and topics between domains 0 and 1 I working directory gt USER_ROUTING_SERVICE xml This file is loaded automatically if it exists 1 File specified using the command line parameter cfgFile The command line option cfgFile see Table 3 1 on page 3 2 can be used to specify a configuration file I File specified using the remote command load The load command see Section 5 2 7 allows loading an XML file remotely The file loaded using this command replaces to the file loaded using the cfgFile command line option Last to be loaded You may use a combination of the above approaches Figure 2 1 shows an example configuration file You will learn the meaning of each line as you read the rest of this chapter 1 See lt Connext installation directory ndds version doc pdf RTI_CoreLibrariesAndUtilities_UsersManual pdf 2 x and y represent part of the version number 2 2 2 3 XML Syntax and Validation Figure 2 1 Example XML Configuration File lt xml version 1 0 gt lt dds gt lt routing service name TopicBridgeExample group_name MyGroup gt domain route name DomainRout
93. ce monitor ing domain_route_data The domain route data describes the configuration of the domain route and its connections but not its contained entities Each connection can be defined with two dif ferent types depending on if it is a DDS connection participant 1 or participant 2 or a generic connection using an adapter lt connection_1 or lt connection_2 The IDL definition of the data type RTI RoutingService Monitoring DomainRouteData is struct DomainRouteParticipantData long domain_id BuiltinTopicKey t participant key struct DomainRouteAdapterConnectionData string lt ENTITY NAME MAX LENGTH plugin name sequence lt Property MAX PROPERTIES property union DomainRouteConnectionData switch AdapterKind case RTI ROUTING SERVICE DDS ADAPTER KIND DomainRouteParticipantData dds case RTI ROUTING SERVICE GENERIC ADAPTER KIND DomainRouteAdapterConnectionData generic Y struct DomainRouteData string lt ENTITY NAME MAX LENGTH routing service name key string lt ENTITY NAME MAX LENGTH name Gkey DomainRouteConnectionData connection 1 DomainRouteConnectionData connection 2 Table 6 2 describes the members of the DomainRouteData data type DomainRouteData Field Name Description i Key field routing_service_name The routing service name assigned using appName Key field name The domain route name This is configured using the name attribute in the
94. config xml e Astring URL such as str lt topic_route gt lt input gt lt datareader_qos gt lt datareader_qos gt lt input gt lt topic_route gt If you omit the URL schema name Routing Service will assume a file name for example home user myconfig xml is equivalent to file home user myconfig xml In either case the XML code can represent either a whole DTD valid configuration file such as the one you specify through the command line when you start Routing Service or a snippet of XML that only refers to a specific entity this is further explained in Section 5 2 12 The remote local parameter is used with file URLs to indicate if the file is local to the shell local or local to the routing service remote If the file is local to the shell local the shell application will read it and will send it as a string URL If the file is local to the routing service remote the shell will send it as a file URL that will be read by the rout ing service The default value is remote If a relative path is specified the path will be relative to the working directory in which the routing service if remote is specified or shell if local is specified is running add_peer add peer target routing service domain route name pl p2 peer list The add peer command passes the peer list to the underlying DomainParticipant s add peer function It is only valid for DomainParticipants in a domain route domain ro
95. d output_samples_per_s Statistic variable that provides information about the output samples per second across routes Output samples refer to the samples that are published out by the session thread using the route s StreamWriters output_bytes_per_s Statistic variable that provides information about the output bytes per second across routes Output bytes refer to the bytes that are published out by the session thread using the route s StreamWriters The variable only considers the bytes of the serialized samples Pro tocol headers UDP RTPS are not included Statistic variable that provides information about the latency in seconds across routes latency_s The latency in a route refers to the time elapsed between the sample read and write This is a good metric to monitor the health and performance of transformations 6 3 5 Status Information for a Route The topic that publishes route status is called rti routing service monitoring route status set The IDL definition of the data type is struct RouteStatusSet string lt ENTITY NAME MAX LENGTH string lt ENTITY NAME MAX LENGTH string lt ENTITY NAME MAX LENGTH string lt ENTITY NAME MAX LENGTH routing service name Gkey domain route name Gkey session name Gkey name key StatisticVariable StatisticVariable StatisticVariable StatisticVariable StatisticVariable input samples per s input bytes per s output samples pe
96. d Defines a SQL content filter for the DataReader Example lt topic_route gt lt input gt lt content_filter gt N A lt content_filter gt Oorl lt expression gt x amp gt 100 lt expression gt lt content_filter gt lt input gt lt topic_route gt Sets the DataReader or DataWriter QoS The contents of this tag are specified in the same manner as a Connext QoS profile file see the chapter on Configuring QoS with XML lt d d gt lt gt D j 1 AEREOS datawriter_qos in the RTI Core Libraries and Utilities User s Vor Manual If the tag is not defined Routing Service will use the Connext defaults 1 See lt Connext installation directory gt ndds lt version gt doc pdf RTI_CoreLibrariesAndUtilities_UsersManual pdf Route Types The tag lt registered_type_name gt within the lt input gt and lt output gt tags contains the registered type name of the stream The actual definition of that type can be set in the configuration file see Section 2 4 6 2 or it can be discovered by the connections see Section 2 4 6 3 Defining Types in the Configuration File To define and use a type in your XML configuration file 1 Define your type within the lt types gt tag This is one of the top level tags see Table 2 1 2 Register it in the connection s participant s where you will use it 3 Refer to it in the domain route s that will use it For example lt dds gt skypasas lt struct name PointType gt
97. d across routes Output bytes refer to the bytes that are published out by the session thread using the auto route s StreamWriters The variable only considers the bytes of the serialized samples Pro tocol headers UDP RTPS are not included latency s Statistic variable that provides information about the latency in seconds across routes The latency in a route refers to the time elapsed between the sample read and write This is a good metric to monitor the health and performance of transformations 6 21 Chapter 7 Traversing Wide Area Networks 7 1 Many systems today already rely on Connext to distribute their information across a Local Area Network LAN However more and more of these systems are being integrated in Wide Area Networks WANs With Routing Service you can scale Connext real time publish subscribe data distribution beyond the current local networks and make it available throughout a WAN Out of the box Routing Service only uses UDPv4 and Shared Memory transports to communicate with other Routing Services and Connext applications This configuration is appropriate for sys tems running within a single LAN However using UDPv4 introduces several problems when trying to communicate with Connext applications running in different LANs L UDPV4 traffic is usually filtered out by the LAN firewalls for security reasons L Forwarded ports are usually TCP ports L Each LAN may run in its own private I
98. d pool size 2 windows iocp concurrency value 1 tls verify ca file A string that specifies the name of a file containing Certificate Authority certificates The file should be in PEM format See the OpenSSL manual page for SSL load verify locations for more information To enable TLS ca file or ca path is required both may be specified at least one is required tls verify ca path A string that specifies paths to directories containing Certificate Authority certificates Files should be in PEM format and follow the OpenSSL required naming conventions See the OpenSSL manual page for SSL CTX load verify locations for more informa tion To enable TLS ca file or ca path is required both may be specified at least one is required 7 14 7 2 Configuring the TCP Transport Table 7 1 TCP TLS Transport Properties over LAN or WAN NDDS Transport_TCPv4_Property_t Property Name prefix with dds transport TCPv4 tcp1 Description tls verify verify depth tls verify crl file Maximum certificate chain length for verification Name of the file containing the Certificate Revocation List File should be in PEM format tls cipher cipher list List of available TLS ciphers See the OpenSSL manual page for SSL set cipher list for more information on the format of this string tls cipher dh param files List of available Diffie Hellman DH key files For examp
99. d within the DDS input and output tags in a lt route gt or lt topic_route gt tag Table 2 10 Route Tags Number Tags within lt route gt Description of Tags Allowed dds i Only applicable to DDS inputs 1 lt input gt i res Defines the route s input topic See Table 2 13 required Only applicable to DDS outputs 1 lt dds_output gt i i Defines the route s output topic See Table 2 13 required Configures remote monitoring for the route See Monitoring Section entity monitoring 2 4 4 and Chapter 6 Monitoring Routing Service from a Remote Loca 0 or 1 tion Only applicable to non DDS inputs 1 input A i Defines the route s input stream See Table 2 13 required Only applicable to non DDS outputs 1 lt output gt Defines the route s output stream See Table 2 13 required 2 23 2 4 XML Tags for Configuring Routing Service Table 2 10 Table 2 11 Route Tags Number Tags within lt route gt Description of Tags Allowed When this tag is true the data samples read from the input stream are written into the output stream with the same timestamp that was asso lt publish_with_ ciated with them when they were made available in the input domain original timestamp This option may not be applicable in some adapter implementations in which the concept of timestamp is unsupported Default false Defines if the
100. dapter struct RTI RoutingServiceVersion plugin version RTI RoutingServiceAdapterPlugin DeleteFcn adapter plugin delete Adapter API 8 11 8 3 Creating New Adapters RTI RoutingServiceAdapterPlugin CreateConnectionFcn adapter plugin create connection RTI RoutingServiceAdapterPlugin DeleteConnectionFcn adapter plugin delete connection Connection API RTI Rou RTI Rou RTI Rou RTI Rou RTI Rou RTI Rou RTI Rou RTI Rou RTI Rou RTI Rou RTI Rou RTI Rou RTI Rou Sess tingServiceConnection Crea tingServiceConnection Dele tingServiceConnection Crea conne tingServiceConnection Dele conne tingServiceConnection Crea conne tingServiceConnection Dele teSessionFcn connection create session teSessionFcn connection delete session teStreamReaderFcn ction create stream reader teStreamReaderFcn ction delete stream reader teStreamWriterFcn ction create stream writer teStreamWriterFcn connection delete stream writer tingServiceConnection GetDiscoveryReaderFcn connection get input stream discovery reader tingServiceConnection GetDiscoveryReaderFcn connection get output stream discovery reader tingServiceConnection CopyTypeRepresentationFcn connection copy type representation tingServiceConnection DeleteTypeRepresentationFcn connection delete type representation tingServiceConnection GetAttributesFcn connection get attributes
101. dapter StreamWriter po Simple File Adapter Adapter is Entry point to the adapter plugin id D11Export struct RTI_RoutingServiceAdapterPlugin SimpleFileAdapter create const struct RTI_RoutingServiceProperties properties RTI_RoutingServiceEnvironment env return NULL 5 Compile the SimpleFileAdapter skeleton by executing gmake from the adapter directory gt gmake After compilation you will find the adapter library in opt adapters simplefile lib lt architecture gt The next few sections will show you how to complete the adapter imple mentation 8 20 8 3 Creating New Adapters 8 3 3 4 Initializing the Adapter Entry Point Function Every adapter plugin must implement a plugin constructor entry point to the dynamic library that will be used by Routing Service to create a plugin instance see Section 8 3 2 In this exam ple the entry point is the function SimpleFileAdapter_create in the file SimpleFileAdapter c You have to initialize this function to create a new plugin Plugin destructor d void SimpleFileAdapter delete struct RTI RoutingServiceAdapterPlugin adapter RTI RoutingServiceEnvironment env Entry point to the adapter plugin el DllExport struct RTI RoutingServiceAdapterPlugin SimpleFileAdapter create const struct RTI RoutingServiceProperties properties RTI Rout
102. dds gt lt transformation library name MyTransfLib gt lt transformation plugin name MyTransfPlugin gt dll mytransformation dll create function MyTransfPlugin create create function transformation plugin raton o iiit eri dace Houses dto Table 4 1 on page 4 2 lists the tags allowed within lt transformation_plugin gt Table 4 2 on page 4 3 lists the tags allowed within a lt transformation gt tag 4 1 4 1 Transformation Usage and Configuration Once a transformation plugin is registered a route can use it to create a data transformation For example the following route uses a transformation to switch the coordinates of the input sam ple x becomes y and y becomes x topic route name SquareSwitchCoord gt input participant 1 gt topic name Square topic name registered type name gt ShapeType lt registered type name gt lt input gt lt output gt topic name Square topic name registered type name gt ShapeType lt registered type name gt output transformation plugin name MyTransfLib MyTransPlugin gt property values element lt name gt X lt name gt lt value gt Y lt value gt lt element gt lt element gt lt name gt Y lt name gt lt value gt X lt value gt lt element gt lt value gt lt property gt lt transformation gt lt topic_route gt Table 4 1 Transformation Plugin Tags Tags within Number lt transformatio
103. der Required for input adapters The StreamReader interface defines methods to read samples return the loan on the read samples update the StreamReader configuration com rti routingservice adapter StreamWriter Required for output adapters The StreamWriter interface defines methods to write samples update the StreamWriter configuration If the constructor does not exist Routing Service will use the default constructor without argu ments MyAdapter Error Notification Routing Service must be notified about errors in the adapter s logic To do so use the following exception com rti routingservice adapter infrastructure AdapterException Adapter Verbosity The property rti routingservice verbosity provided to the Adapter constructor can be used to get the verbosity level used to run Routing Service Table 8 11 describes the mapping between the command line option verbosity and the values of the property rti routingservice verbosity Table 8 11 Mapping between verbosity and rti routingservice verbosity verbosity rti routingservice verbosity 0 none exception 2 warn 8 38 8 3 Creating New Adapters 8 3 6 8 3 6 1 8 3 6 2 Table 8 11 Mapping between verbosity and rti routingservice verbosity verbosity rti routingservice verbosity 3 and 4 info 5 and 6 debug My First Java Adapter This section shows how to create a simp
104. desc name DomainRoutel Sessionl TopicRoutel When we use an XML snippet the first tag we specify is that of the entity topic route in this case strcpy cmdRequest command u entity desc xml url content str lt topic_route gt lt input gt lt datareader_qos gt lt deadline gt lt period gt lt sec gt 10 lt sec gt lt period gt lt deadline gt lt datareader_qos gt lt input gt lt topic_route gt The content above is small enough to send it in one sample Otherwise if the length were gt XML URL MAX LENGTH we would have to split it in multiple partial strings each XML URL MAX LENGTH and set is final 0 for all the samples but the last one cmdRequest command u entity desc xml url is final 1 RTI RoutingService CommandRequest writer write cmdRequest Example 2 Using the Request Reply Communication Pattern This example uses the RTI Connext Messaging Request Reply API This example shows a Java application that creates a Requester that can communicate with the Routing Service remote administration server It sends two requests Routing Service remote commands to disable and then enable Routing Service Each request receives a reply with the result for that command When using the Request Reply API Routing Service will efficiently deliver those replies only to the original Requester Note In the command topic the values for id host and id app are n
105. e gt participant 1 domain id 0 domain id participant 1 participant 2 domain id 1 domain id participant 2 session name Session gt topic route name SquaresToCircles gt lt input participant 1 gt registered type name gt ShapeType lt registered_type name gt topic name Square topic name input output registered type name gt ShapeType lt registered type name gt topic name Circle c topic name output topic route lt session gt lt domain_route gt routing service gt lt dds gt This file configures a simple bridge from domain 0 to domain 1 and changes the data s topic from Square to Circle Both topics use the same data type ShapeType You will find this example in lt Routing Service installation directory gt example shapes topic_bridge xml Additional examples are in the same directory 2 3 XML Syntax and Validation The XML configuration file must follow these syntax rules The syntax is XML the character encoding is UTF 8 L Opening tags are enclosed in lt gt closing tags are enclosed in lt gt LI A tag value is a UTF 8 encoded string Legal values are alphanumeric characters Routing Service s parser will remove all leading and trailing spaces from the string before it is processed For example tag value lt tag gt is the same as lt tag gt value lt tag gt J All values are case sensitive unless
106. e this does not take a prefix Comma separated strings indicating the prefix names of all plugins that will be loaded by Connext For example dds transport TCPv4 tcp1 You will use this string as the prefix to the property names See Footnote 1 on page 7 15 Note you can load up to 8 plugins Required Must be nddstransporttcp library This library needs to be in the path during run time in the LD_LIBRARY_PATH envi ronment variable on UNIX systems in PATH for Windows systems create_function Required Must be NDDS_Transport_TCPv4_create Used to register the transport plugin returned by NDDS_Transport_TCPv4_create as specified by lt TCP_prefix gt create_function to the DomainParticipant Aliases aliases should be specified as a comma separated string with each comma delimiting an alias Default the transport prefix see Footnote 1 Must be set to one of the following values NDDS_TRANSPORT_CLASSID_TCPV4_LAN for TCP communication within a LAN NDDS_TRANSPORT_CLASSID_TLSV4_LAN for TLS communication within a LAN NDDS_TRANSPORT_CLASSID_TCPV4_WAN for TCP communication across LANs and firewalls NDDS_TRANSPORT_CLASSID_TLSV4_WAN for TLS communication across LAN and firewalls Default NDDS_TRANSPORT_CLASSID_TCPV4_LAN parent classid 7 7 7 2 Configuring the TCP Transport Table 7 1 TCP TLS Transport Properties over LAN or WAN NDDS Transport_TCPv4_Property_t P
107. e Routes Section 2 4 6 0 or more lt wait_set gt Configures the WaitSet used to sleep and notify the session thread when data is available Example lt session gt lt wait_set gt max event count 5 max event count max event delay lt sec gt 1 lt sec gt lt nanosec gt 0 lt nanosec gt lt max_event_delay gt lt wait_set gt lt session gt In the previous example the session thread wakes up and tries to read data after a 1 second timeout expires max_event_delay or after it has been notified five times across routes that new data is available max_event_count Default values max_event_count 1 max_event_delay sec DURATION_INFINITE_SEC max_event_delay nanosec DURATION_INFINITE_NSEC Oor1 1 See lt Connext installation directory ndds version doc pdf RTI CoreLibrariesAndUtilities UsersManual pdf Routes A route explicitly defines a mapping between an input data stream on one domain and an output data stream on the other domain For example the following route defines a mapping between a topic called Square and a JMS queue called Square 2 21 2 4 XML Tags for Configuring Routing Service lt dds gt lt routing service gt lt domain_route gt lt participant_1 gt lt domain_id gt 54 lt domain_id gt lt participant_1 gt connection 2 plugin name my adapter library jms gt connection 2 session name Session1 gt route n
108. e by using the unregister instance p edid operation 0or1 PICS This action may be overwritten by the execution of a transformation Default true Writes the data sample as if they came from its original writer Setting publish with this option to true allows having redundant routing services and pre original info vents the applications from receiving duplicate samples Jor Default false When this tag is set to true the data samples are written with their publish with original source timestamp Oor1 original timestamp Default false 2 24 2 4 XML Tags for Configuring Routing Service Table 2 11 Table 2 12 Table 2 13 Topic Route Tags Biv Number Tags within da Description of Tags topic route Allowed Defines if the input domain will use types discovered in the output domain and vice versa for the creation of DataWriters and DataRead route types ers in the topic route Dori See Discovering Types Section 2 4 6 3 Default false Sets a data transformation to be applied for every data sample see lt transformation gt Data Transformation Section 2 4 6 5 Den Input and Output Tags for a Route Tags within Number input and Description of Tags output Allowed Specifies when to create the StreamReader StreamWriter Default IMMEDIATE creation mode Oor1 See Creation Modes Controlling when StreamReaders and Stream Writers
109. e ip represents the IPv4 address and port is the external port number of the router Note that host names are not allowed in the public address because they may resolve to an internet address that is not what you want i e localhost may map to your local IP or to 127 0 0 1 server bind port Private IP port inside the LAN used by the transport to accept TCP connections If this property is set to zero the transport will disable the internal server socket mak ing it impossible for external peers to connect to this node In this case the node is con sidered unreachable and will communicate only using the asynchronous mode with other reachable peers For WAN communication this port must be forwarded to a public port in the NAT enabled router that connects to the outer network Default 7400 read buffer allocation Allocation settings applied to read buffers These settings configure the initial number of buffers the maximum number of buffers and the buffers to be allocated when more buffers are needed Default LJ read buffer allocation initial count 2 J read buffer allocation max count 1 unlimited read buffer allocation incremental count 1 number of buffers will keep doubling on each allocation until it reaches max count 7 10 7 2 Configuring the TCP Transport Table 7 1 TCP TLS Transport Properties over LAN or WAN NDDS_Transport_TCPv4_Property_t Property Name
110. e method name LI 4 Breakpoint Type Method Settings Class Name Jroutingservice adapter simplefile SimpleFileAdapter All Methods for Given Class Method Name lt init gt Stop On method Entry m Conditions Condition l Break when hit count equals to Y Actions Suspend Breakpoint thread Print Text Method breakpoint hit in className method ame at line 4 Cancel c Press OK 5 Attach the debugger to Routing Service JVM a Select Debug Attach Debugger b For the Host enter the name of the host where Routing Service is running c For the Port enter 8192 I as Debugger ova Debugger JPDA Y Connector socketattach Attaches by socket to other Ms Transport fitsocket 0 ooo aK Port ped oo Timeout ms Y d Press OK to start debugging the adapter Cancel Help 8 58 8 3 Creating New Adapters 8 3 8 Testing an Adapter A simple Java test adapter is provided with Routing Service Adapter SDK You will find the class com rti routingservice adapter test TestAdapter in rtirsadapter jar This is a convenient way to test your own adapters The TestAdapter is used as an output adapter that counts the number of samples that meet certain conditions defined in the configu ration file Your adapter will act as the input and its samples will be passed to the TestAdapter If the num ber of samples recei
111. e propagates NOT_ALIVE_DISPOSE samples The propagation of NOT_ALIVE_DISPOSE samples is configured using the tag lt propagate_dispose gt in lt topic_route gt propagate_unregister DDS auto_topic routes only Indicates if the topic routes propagate NOT_ALIVE_NO_WRITERS samples The propagation of NOT_ALIVE_NO_WRITERS samples is configured using the tag lt propagate_unregister gt in lt auto_topic_route gt publish_with_original_info DDS auto_topic routes only Indicates if the topic routes publish the samples with original writer information Setting this option to true allows redundant topic routes and prevents applications from receiving duplicate samples The publication with original writer info is configured using the tag lt publish_with_original_info gt inside lt auto_topic_route gt publish_with_original_ timestamp Indicates if the routes are configured to publish the output samples with the same timestamp as that of the input sample enabled_route_count The number of enabled routes associated with the auto route The configuration of the auto route input as contained in the tag lt input gt or allow_stream_ name_filter i t ME mee lt dds_input gt inside lt auto_route gt or lt auto_topic_route gt Topics that do not pass this filter in the input participant will not trigger the cre input ation of routes This filter is configured using the tag lt allow_topic_name_filter
112. eamReader null NotificationThread StreamReader streamReader StreamReaderListener listener BufferedReader fileReader int notificationPeriod this listener listener this fileReader fileReader this notificationPeriod notificationPeriod this streamReader streamReader terminate false public void run while terminate try Thread sleep notificationPeriod if fileReader ready listener onDataAvailable streamReader catch Exception e public void terminate terminate true public void setReadPeriod int readPeriod notificationPeriod readPeriod Implementing the StreamWriter Class A StreamWriter provides a way to write samples of a specific type into a data domain In the configuration file StreamWriters are associated with the tag lt output gt within lt route gt or lt auto_route gt see Section 2 4 6 The SimpleFileAdapter StreamWriters create new files in the connection directory and store the lines read from the routes inputs The data samples provided to the StreamWriters write operation are DynamicData with the fol lowing IDL type struct TextLine string lt 1024 gt value 8 49 8 3 Creating New Adapters y When a SimpleFileAdapter StreamWriter is created the name of the file is the output stream name with a txt extension For debugging purposes the StreamWriter can be configured to print
113. eation of new custom adapters Real Time Applications a le Plug in Adapters sota e Routing Service JMS Socket LINK11 CANbus Quickly build and deploy bridges between natively incompatible protocols and technologies using Connext 1 2 Available Documentation 1 1 Available Documentation Routing Service documentation includes 1 Getting Started Guide RTI Routing Service GettingStarted pdf Highlights the bene fits of Routing Service It provides installation and startup instructions and walks you through several examples so you can quickly see the benefits of using Routing Service L Release Notes RTI Routing Service ReleaseNotes pdf Describes system require ments and compatibility as well as any version specific changes and known issues LJ Users Manual RTI Routing Service UsersManual pdf Describes how to configure Routing Service and use it remotely If the optional RTI Routing Service Adapter SDK is installed you will also have the following doc uments 2 RTI Routing Service Adapter SDK Installation Guide RIT Routing Service AdapterSDK InstallationGuide pdf Describes installation instructions for RTI Routing Service Adapter SDK 2 RTI Routing Service Adapter SDK Release Notes RII Routing Service AdapterSDK ReleaseNotes pdf Describes system requirements and compatibility as well as any version specific changes and known issues for RTI Rout ing Service Adapter SDK
114. ecified in the same manner as a Connext QoS pro 0or1 file file see the chapter Configuring QoS with XML in the RTI Core Libraries and Utilities User s Manual If the tag is not defined Routing Service will use the Connext defaults lt route gt Defines a data mapping between two streams See Routes Section 2 4 6 0 or more Only applicable to Connext Sets the QoS associated with the session Subscribers There is one Subscriber er participant lt subscriber_ per p P RS qos The contents of this tag are specified in the same manner as a Connext QoS pro 0or1 file file see the chapter Configuring QoS with XML in the RTI Core Libraries and Utilities User s Manual If the tag is not defined Routing Service will use the Connext defaults 2 20 2 4 XML Tags for Configuring Routing Service Table 2 9 2 4 6 Session Tags Tags within lt session gt Description Number of Tags Allowed lt thread gt Sets the mask priority and stack size of the thread associated with this session Example lt session gt lt thread gt lt mask gt MASK_DEFAULT lt mask gt lt priority gt THREAD PRIORITY DEFAULT lt priority gt lt stack_size gt THREAD STACK SIZE DEFAULT lt stack_size gt lt thread gt pou Default values mask MASK DEFAULT priority THREAD PRIORITY DEFAULT stack size THREAD STACK SIZE DEFAULT Oor1 topic route Defines a data mapping between two topics Se
115. ed to incorporate the latest changes and is propagated afterwards StreamReader s Filter Set by Configuration When filter propagation is used in combination with static filter configuration tag lt content_filter gt the StreamReader s composed filter is calculated as follows CF Feanf CF cont C F4 U F gt weak Fry In the previous expression Fon represents the configuration filter and CF is the composed fil ter considering Feonf The composed filter CF is the intersection of the configuration filter with the filter resulting from the union of the matching DataReaders filters and it allows passing any sample that passes the configuration filter and at least one of the DataReader s filters For the SQL filter the intersection operator is AND CF sar Fcont AND Fsqu1 OR Fsai2 OR Fsain Setting a configuration filter affects the initial filter of the route s StreamReader In this case the initial filter is not the stop band filter but the configuration filter itself Table 9 1 summarizes the StreamReader s filter that is propagated under the events described in previous section considering configuration filter Propagated StreamReader s Filter Depending on Configuration Filter StreamReader s Filter Event Configuration Filter No Configuration Filter Route s StreamReader creation Feo nf Stop band Discovery of DataReader using SQL filter or F A CF CF Filter change in a DataReader us
116. ed using the output StreamReader In the built in DDS adapter the output StreamReader is associated with the subscription built in DataReader of the DomainParticipant The samples provided by the discovery StreamReaders have the type RoutingServiceStreamInfo struct RTI_RoutingServiceStreamInfo int disposed char stream_name struct RTI RoutingServiceTypeInfo type info The dispose member is used to indicate whether the stream is a new discovered stream or a dis posed stream The type info member provides information about the type associated with the stream struct RTI RoutingServiceTypeInfo char type name RTI RoutingServiceTypeRepresentationKind type representation kind RTI RoutingServiceTypeRepresentation type representation The content associated with the type representation depends on the type representation kind For example if the representation kind is RTI ROUTING SERVICE TYPE REPRESENTATION DYNAMIC TYPE the type representation member will contain a DDS TypeCode The method copy_type_representation is used by Routing Service to copy the type representation associ ated with a discovered stream Reading Data Routing Service uses the session threads there is one per lt session gt tag to read data from StreamReaders 8 9 8 3 Creating New Adapters Each session thread will block waiting for new data using a WaitSet When a StreamReader receives new data it will use the StreamReader
117. ee e ad RE ods seul AE aban OR e ANS AAN 8 8 52 2 Stream DIiSCOVery iia Soie 8 8 8 29 Reading Data casseosueo meme duties pee re Era in pede risa 8 9 8 3 Creating New Adapters o tee imac idiota 8 10 8 31 Adapter SDK Components iecit acid 8 10 832 CO Adapter APT see e eee edet eoe entente dtr ied ii a e 8 11 8 399 My First C Adapter oe ee nte ee e ren RI EE Fere e esperti teste itte ds 8 14 83 4 Debugging C Adapters ne een e eee re ini e i eere e 8 35 8 3 5 Java Adapter APE 5 ccce tene eee ete e e etel e e tertie tus 8 37 83 6 My First Java Adapter ica orti a aee iei A rette nd tree P I e eed 8 39 8327 Debugging Java Adapters ee eee enne nennen nennen nennen 8 54 8 3 9 Testing an Adapter sette rn a e rr eee ree eoa 8 59 9 Propagating Content Filters 9 1 9 2 9 3 Enabling Filtet Propagation ioci Idee bn dete dee eere biete te RA RS 9 2 Filter Propagation Behavior i e tee ie te ee dee mere ra e t ne ne denen bid 9 2 9 2 1 Filter Propagation Events eiecit nfi re als he d ee eee Hb e idest uid 9 3 9 22 StreamkReader s Filter Set by Configuration ssssssseeeee eee ee eene 9 4 92 3 Remote Administratlons A neci eter voie ect Du eid oa i e t er e e en deas 9 4 Restri coh iei iore en iib etie s ii eese itae inier i dite 9 5 Chapter 1 Welcome fo RTI Routing Service Welcome to RTI Routing Service an out of the box solution for integrating disparate and geo graphically dispersed sy
118. entifier for the second participant connection 2 generic plugin name The name of the plugin used by the second connection connection 2 connection 2 generic property The sequence of properties defined in the tag property inside connection 2 A domain route using DDS can be correlated with its corresponding participants using the fields connection 1 dds participant key and or connection 2 dds participant key For example let s assume that we want to get the value of the PropertyQosPolicy associated with the first DomainParticipant of a domain route To do that we would subscribe to the partic ipant builtin topic and look for a sample where the key member is equal to participantl key From this sample we can get the PropertyQosPolicy by accessing the member called property For additional information on how to subscribe to builtin topics see the RTI Core Libraries and Utilities User s Manual Domain route data samples are published when LJ The domain route is enabled I The domain route is disabled dispose sample l Monitoring is enabled via remote administration Configuration Data for a Session The topic that publishes session configuration data is called rti routing_service monitoring session_data The session data describes the configuration of the session but not its contained entities The IDL definition of the data type is struct SessionData string lt ENTITY_NAME MAX LENGTH
119. erations Description The StreamWriter API is only required when the adapter is used to pro Operation duce data Otherwise it is optional Updates the configuration of a StreamWriter providing a new set of properties date This method is called after the update command is received by the routing service route up containing the StreamWriter see Section 5 2 12 Implementation of this API is optional Writes a collection of data samples and sample infos in the data domain associated with write the StreamWriter Implementation of this API is required if the adapter is used to produce data 8 2 Adapter API And Entity Model 8 2 1 Entity Creation The sequence diagram in Figure 8 2 shows how the different Routing Service entities are created Figure 8 2 Entity Creation Sequence Diagram adapter library name adapters gt adapter plugin name file gt lt dll gt fileadapter lt dll gt lt create_function gt adapter plugin adapter library 2 create connection domain route 3 create Connectiont Connection connection 1 plugin_name adapters file gt lt property gt lt value gt lt element gt 5 create Connection2 Connection lt value gt lt property gt lt connection_1 gt lt connection_2 plugin_name adapters fi
120. eriod For the up time metrics this field contains the time since the entity was enabled For the other windows this field con tains a fixed value that identifies the window size 5000 for the 5 second window 60000 for the one minute window etc Statistics Calculation The accuracy of the statistics calculation process is determined by the value of the statistics sam pling period This period specifies how often statistics are gathered and is configured on a per entity basis using the tag statistics sampling period see Section 2 4 4 As a general rule the statistics sampling period of an entity must be smaller than its status publication period A small statistics sampling period provides more accurate statis tics at expense of increasing the memory consumption and decreasing performance 6 15 6 3 Monitoring Status 6 3 2 Status Information for the Routing Service The topic that publishes routing service status is called rti routing service monitoring routing service status set The IDL definition of the data type is struct RoutingServiceStatusSet string lt ENTITY NAME MAX LENGTH name key StatisticVariable cpu usage percentage StatisticVariable physical memory kb StatisticVariable total memory kb long uptime StatisticVariable host cpu usage percentage StatisticVariable host free memory kb unsigned long host total memory kb StatisticVariable host free swap memory kb unsigned long host total
121. ervice will create a DomainParticipant Publisher Subscriber DataWriter and DataReader in the designated domain The QoS values for these entities are described in the Routing Service User s Manual This option overwrites the value of the tag domain id within a administration tag See the Routing Service User s Manual for infor mation on configuring remote access Default Remote administration is not enabled unless it is enabled from the XML file 3 2 Stopping Routing Service Table 3 1 RTI Routing Service Command line Options Option Description remoteMonitoringDomainId ID Enables remote monitoring and sets the domain ID for status publica tion When remote monitoring is enabled Routing Service will create one DomainParticipant one Publisher five DataWriters for data publica tion one for each kind of entity and five DataWriters for status publi cation one for each kind of entity The QoS values for these entities are described in the Routing Service User s Manual This option overwrites the value of the tag domain id within a monitoring tag See the Routing Service User s Manual for informa tion on configuring remote monitoring Default Remote monitoring is not enabled unless it is enabled from the XML file stopAfter sec Stops the service after the specified number of seconds use42eAlignment Enables compatibility with RTI Data Distribution Serv
122. est getData id host 1 request getData id app 1 request getData id invocation 1s TestRouter request getData target_router request getData command _d CommandKind RTI ROUTING SERVICE COMMAND DISABLE requester sendRequest request Receive the reply Sample lt CommandResponse gt reply requester createReplySample boolean received requester receiveReply reply MAX WAIT if received throw new IllegalStateException Response not received System out println Received response reply getData message Send ENABLE command request getData id invocation 2 request getData command d CommandKind RTI ROUTING SERVICE COMMAND ENABLE requester sendRequest request Receive the reply received requester receiveReply reply MAX WAIT if received throw new IllegalStateException Response not received System out println Received response reply getData message finally requester close finally participant delete contained entities j DomainParticipantFactory get instance delete participant participant 5 11 Chapter 6 Monitoring Routing Service from a Remote Location You can monitor Routing Service remotely by subscribing to special topics By subscribing to these topics any Connext application can receive information about the configuration and oper ational status of Routing Service Being able to moni
123. ew Adapters 2 Create a directory that will contain the adapter makefile and implementation The rest of this section assumes that opt adapters simplefile is the adapter directory 3 In opt adapters simplefile create a file called makefile with the following content EHE HE E E HE HE HE HEHE HE HE HE HE PEE HE HE HE HE HE HE HE HE HE HEHE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE H H H HH H HH HHH HHH HHHH Makefile to build libsimplefileadapter so EE HE HE HE HE HEHE HEHE HE HE HE HE PEE HE HE HE HE HE HE HE HE HE HEHE HE HEHE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE H HE H H H H HH HHH HHH HHHH ARCH i86Linux2 6gcc4 4 5 c cec gcc c ld gcc ifeq DEBUG 1 c cc flags m32 g else c cc flags m32 endif c ld flags m32 static libgcc syslibs ldl lnsl lm lpthread DEFINES ARCH SPECIFIC DRTI_UNIX DRTI_LINUX DEFINES DEFINES ARCH SPECIFIC INCLUDES I I NDDSHOME include 1I NDDSHOME include ndds I ROUTINGSERVICEHOME include LIBS L NDDSHOME lib ARCH L ROUTINGSERVICEHOME bin ARCH lnddsc lnddscore lrtirsinfrastructure syslibs extralibs COMMONSOURCES SimpleFileAdapter c SHAREDLIB lib ARCH libsimplefileadapter so DIRECTORIES lib dir lib ARCH dir objs dir objs ARCH dir COMMONOBJS COMMONSOURCES c objs ARCH 0 S ARCH DIRECTORIES S COMMONOBJS SHAREDLIB SHAREDLIB COM
124. ew Project Build Debug Tools Test Window Help Bl El ge d H A a O C He emm pem HA he EF 019a 4e Wr SES CA og Solution SimpleFileAdapter 1 proje E cH SimpleFileAdapter Header Files Resource Files E Source Files SimpleFileAdapter c include lt stdio h gt L include lt string h gt Ejgifdef RTI_WIN32 finclude lt process h gt E else c E f 555 3 8 R AAA AAA B AA AAA AAA AAA AA AAA TA TT Simple File Ada JR e n NR s AAA RAAT ERAT e e d e e t d e n n d n E L finclude lt pthread h gt endif 8 Build the SimpleFileAdapter project and verify that there are no errors Note If you intend are using a 64 bit version of Routing Service you need to configure your Visual Studio solution as follows right click on the solution in the Solution Explorer Properties Configuration Manager Click on the drop down list for Platform choose lt New gt then x64 8 3 3 3 Creating an Adapter makefile Only for UNIX based systems In this section you will create a makefile to generate and compile the adapter shared library 1 The makefile that you will generate is intended to be used with the GNU distribution of the make utility On modern Linux systems the make binary typically is GNU make On other systems GNU make is called gmake The instructions below use gmake Make sure that the GNU make binary is on your path before continuing 8 18 8 3 Creating N
125. ew data domains 1 Implement the adapter plugin API in Java or C See Chapter 8 Extending Routing Ser vice with Adapters for more information 2 Register the plugin in the configuration file by creating an lt adapter_plugin gt tag or a lt java_adapter_plugin gt inside an lt adapter_library gt tag As noted in Table 2 1 lt adapter_library gt is a top level tag 3 Instantiate an adapter connection by creating a lt connection gt tag inside a lt domain_route gt tag that refers to the adapter plugin For additional information about adapters see Chapter 8 Extending Routing Service with Adapters 2 5 Enabling and Disabling Routing Service Entities The Routing Service entities associated with the tags routing service domain route route topic route auto route and auto topic route can be created enabled or dis abled using the attribute enabled By default the value of the enabled attribute is true For example lt dds gt lt routing service name TopicBridgeExample group name rti router default enabled true gt lt domain route name DomainRoute enabled false gt lt participant_1 gt lt domain_id gt 0 lt domain_id gt lt participant_1 gt lt participant_2 gt lt domain_id gt 1 lt domain_id gt lt participant_2 gt lt session name Session gt topic route name SquaresToCircles enabled false gt lt input participant 1 gt registered type name gt Shape
126. excluded This is applied after the allow registered type name filter i i 1 deny registered type name filter You may use a comma separated list to specify more eer than one filter Default Not applied A stream name filter that should be denied excluded This is applied after the lt allow_stream_name_filter gt lt deny_stream_name_filter gt Oorl You may use a comma separated list to specify more than one filter Default allow all A topic name filter that should be denied excluded This is applied after the lt allow_topic_name_filter gt lt deny_topic_name_filter gt You may use a comma separated list to specify more 0 or 1 than one filter Default Not applied The topic routes are created with this configuration Sequence of name value string pairs that can be used to configure certain parameters of the StreamReaders StreamWriters associated with the routes created from the auto route For example lt property gt lt value gt lt property gt lt element gt 0or1 lt name gt com rti socket port lt name gt lt value gt 16556 lt value gt lt element gt lt value gt lt property gt 1 As defined by the POSIX fnmatch API 1003 2 1992 section B 6 2 See Connext installation directory ndds lt version gt doc pdf RTI_CoreLibrariesAndUtilities_UsersManual pdf Adapters Adapters are pluggable components that allow Routing Service to co
127. ffer If it is set too large Connext not only won t be able to send more data it also won t be able to receive any more data because of an internal resource mutex Setting this property to 0 causes the low level function to report an immediate failure if the TCP send buffer is full Setting this property to 1 causes the low level function to block forever until space becomes available in the TCP buffer Default 3 seconds socket monitoring kind Configures the socket monitoring API used by the transport This property can have the following values e SELECT The transport uses the POSIX select API to monitor sockets e WINDOWS IOCFP The transport uses Windows I O completion ports to monitor sockets This value only applies to Windows systems WINDOWS WAITFORMULTIPLEOBJECTS The transport uses the API WaitFor MultipleObjects to monitor sockets This value only applies to Windows systems Default SELECT Note The value selected for this property may affect transport performance and scal ability On Windows systems using WINDOWS IOCP provides the best performance and scalability windows iocp Configures I O completion ports when socket monitoring kind is set to WINDOWS IOCP This setting configures the number of threads monitoring sockets thread pool size and the number of threads that the operating system can allow to concurrently process I O completion packets concurrency value Defaults windows iocp threa
128. ffer_min_size For all DataReaders and DataWriters or iore the way Connext allocates memory for samples is as follows Connext pre allocates space for samples up to size X in the reader and writer queues If a sample has an actual size greater than X the memory is allocated dynamically for that sample The default size is DDS_LENGTH_UNLIMITED meaning no dynamic memory is used the maximum sample size is pre allo cated 1 sample buffer trim to size If set to true after allocating dynamic memory for very large samples that memory will be released when possible If false that memory will not be released but kept for future samples if needed The default is false management This feature is useful when a data type has a very high maximum size e g megabytes but most of the samples sent are much smaller than the maximum possible size e g kilobytes In this case the memory footprint is reduced dramatically while still correctly handling the rare cases in which very large samples are published 2 11 2 4 XML Tags for Configuring Routing Service Table 2 5 Participant Tags Tags within lt participant_1 2 gt Description Number of Tags Allowed lt registered_type gt Registers a type name and associates it with a type code When you define a type in the configuration file with the lt types gt tag you have to register the type in order to use it in topic routes See Route Types
129. gt ReadMe html lt Routing Service home gt doc pdf Adapter Sample Code The SDK provides three buildable adapter implementations two in C file and socket and one in Java JMS For instructions on compiling and using the sample adapters see Section 4 9 Section 4 10 and Section 4 11 in the Getting Started Guide Sample Code lt Routing Service home gt adapters Sample Configuration Files lt Routing Service home gt example shapes 8 10 8 3 Creating New Adapters Table 8 8 Adapter SDK Components 8 3 2 Component Description SDK jar file rtirsadapter jar The SDK jar file provides the necessary interfaces and support classes to imple ment Java adapters see Section 8 3 5 In addition the JAR file also includes an implementation of a test adapter Test Adapter that can be used to test new input adapters implementations JAR Location lt Routing Service home gt class rtirsadapter jar SDK infrastructure shared library Lib rtirsinfrastructure dll so The infrastructure library provides environment see Section 8 3 2 1 and proper ties management functions for C adapters The C adapters will have to link with this library Library Location lt Routing Service home gt bin lt architecture gt lib rtirsinfrastructure dll so The C adapters will have to include two SDK header files routingservice_adapter h This header file defines the adapter API
130. gt inside lt auto_topic_route gt lt input gt or inside lt auto_route gt lt dds_input gt or the tag allow stream name filter inside lt auto_route gt lt input gt input allow registered type name filter Topic with types that do not pass this filter in the input participant will not trig ger the creation of routes This filter is configured using the tag allow registered type name filter inside auto topic route input auto route dds input Or auto route input input deny stream name filter Topics that pass this filter in the input participant will not trigger the creation of routes This filter is configured using the tag deny topic name filter inside auto topic route input or inside auto route dds input or the tag deny stream name filter inside auto route input 6 12 6 2 Monitoring Configuration Data Table 6 5 AutoRouteData Field Name Description input deny_registered_ type_name_filter Topics with types that pass this filter in the input participant will not trigger the creation of routes The input deny registered type name filter is configured using the tag deny registered type name filter inside lt auto_topic_route gt lt input gt auto route dds input or auto route input Index of the input connection or participant 1 or 2 creation mode input
131. h them to an entity such as a DomainParticipant The configuration of the TCP transport with Routing Service is done using the PropertyQosPolicy of the Domain Participants that are going to use the trans port For a list of the properties that you can set for the TCP transport see the RTI Core Libraries and Utilities User s Manual In the following example participant_1 will communicate with other participants on the same LAN using UDP and Shared Memory transports participant_2 will communicate with other participants in different LANs using the TCP transport 1 See lt Connext installation directory ndds version doc pdf RTI_CoreLibrariesAndUtilities_UsersManual pdf 7 5 7 2 Configuring the TCP Transport Figure 7 5 Initial Peers in WAN Communication LAN IP address LAN IP address 192 168 1 11 192 168 5 11 Server Bind Port Server Bind Port 7400 Initial 7500 Peers Initial Peers 18 181 0 32 8500 192 168 1 11 8400 WAN IP address 18 181 0 31 WAN IP address 18 181 0 32 Port forward settings Port forward settings WAN port 8400 to 192 168 5 11 7400 WAN port 8500 to 192 168 5 11 7500 lt dds gt routing service name MyRoutingService gt domain route name MyDomainRoute gt lt participant_1 gt lt domain_id gt 56 lt domain_id gt lt participant_1 gt lt participant_2 gt lt domain_id gt 57 lt domain_id gt participant gos transport builtin lt mask gt MASK_N
132. hat as part of the adapter implementation you instrument the code by adding status messages that will be printed with the INFO and DEBUG verbosity levels This level of instrumentation will help you to capture run time information for troubleshooting 8 35 8 3 Creating New Adapters 8 3 4 1 The second debugging capability is provided by third party tools On a Windows system you can debug the adapter shared libraries using Visual Studio On a UNIX based system you can use GDB the GNU Project debugger Debugging the Adapter with Visual Studio only for Windows Systems Let s see how to debug the adapter library with Visual Studio 2008 using the SimpleFileAdapter implemented in Section 8 3 3 1 Start Microsoft Visual Studio 2008 and open the solution SimpleFileA dapter 2 In the Solution Configuration combo box select Debug configuration and recompile the SimpleFileAdapter project 3 Edit simple_file_adapter xml the configuration file generated in Section 8 3 3 8 Replace the library in the lt dll gt tag with the debug version of the adapter For example lt dllsc adapters SimpleFileAdapter Debug SimpleFileAdapter dll lt dll gt 4 Right click on SimpleFileAdapter Properties SimpleFileAdapter Property Pages L2 x Configuration Jactive Debug y Platform activetwinsz y Configuration Manager Common Properties Debugger to launch Configuration Properties Local Windows Debugger General
133. hat writer side filtering is allowed 9 1 9 1 Enabling Filter Propagation Enabling filter propagation will make it possible to perform writer side filtering from the user DataWriters since they receive a composed filter that represents the data set subscribed by all the user DataReaders as shown in Figure 9 2 Figure 9 2 System Behavior with Filter Propagation 9 1 9 2 Sample H filtering Sample filtering Communication direction filtering X _ Filter propagation direction With propagation user DataWriters receive a composed filter that allows writer side filtering thus sending only samples in which user DataReaders are interested Enabling Filter Propagation Filter propagation is disabled by default in Routing Service You can enable filter propagation with the lt filter_propagation gt tag see Routes Section 2 4 6 available under the topic route configuration see Topic Route Tags Table 2 11 and auto topic route configuration see Auto topic Route Tags Table 2 17 Filter propagation is supported only in topic routes and auto topic routes use the DDS adapter and the built in SQL filter See Filter Propagation Behavior Section 9 2 for further restrictions Filter Propagation Behavior Without filter propagation the only way to enforce writer side filtering in a scenario involving one or more Routing Services between the user DataWriters and user DataReaders see Figure 9
134. hen an update Section 5 2 12 command tar lt autosave_on_ gets a routing service Oorl update gt This value is sent as part of the monitoring configuration data for the routing service see Configuration Data for Routing Service Section 6 2 1 Configures the DataReader QoS for remote administration If the tag is not defined Routing Service will use the Connext defaults with the following changes lt datareader_qos gt reliability kind DDS_RELIABLE_RELIABILITY_QOS this value 0 or 1 cannot be changed history kind DDS_KEEP_ALL_HISTORY_QOS resource_limits max_samples 32 Configures the DataWriter QoS for remote administration If the tag is not defined Routing Service will use the Connext defaults lt datawriter_qos gt with the following changes Oor1 history kind DDS KEEP ALL HISTORY QOS resource limits max samples 32 Confi RTI Distributed L lt distributed_logger gt Pe M GA e Oorl See Enabling RTI Distributed Logger in Routing Service Section 2 6 2 13 2 4 XML Tags for Configuring Routing Service Table 2 6 Remote Administration Tags 2 4 4 cs Number Tags within s administration Description of Tags Allowed e Specifies which domain ID Routing Service will use to enable remote 1 domain id p administration required Configures the DomainParticipant QoS for remote administration lt participant_qos gt
135. his field is meaningful only when the state is datareader key RII ROUTING SERVICE CREATED AND ENABLED E d DDS input only Content filter expression associated with the content filter a ala for the topic route DataReader s content titer The expression is configured using the tag lt content_filter gt lt expression gt expression inside lt topic_route gt lt input gt or lt route gt lt dds_input gt input adapter_data Not applicable for DDS input The properties used to configure this route s generic StreamReader specified with the tag lt property gt inside lt route gt lt input gt property es ay The configuration of the route s output as contained in the tag lt output gt or OWP lt dds_output gt inside lt route gt or lt topic_route gt Output stream name output The output stream name is configured using the tag lt topic_name gt inside stream_name lt topic_route gt lt output gt or inside lt route gt lt dds_output gt or the tag lt stream_name gt inside lt route gt lt output gt Output registered name output registered_type_ The cdd registered row is configured using the tag name lt registered_type_name gt inside lt topic_route gt lt output gt route dds output or route output output Indicates when the StreamWriter in created in the output creation mode The output creation mode is configured using the tag creation mode utput
136. ic final Duration t MAX WAIT new Duration t 10 0 public static void main String args throws InterruptedException Create DomainParticipant DomainParticipant participant DomainParticipantFactory get instance create participant 55 DomainParticipantFactory PARTICIPANT QOS DEFAULT null StatusKind STATUS MASK NONE if participant null throw new IllegalStateException Participant creation failed try Create requester for the Routing Service remote admin topics Requester CommandRequest CommandResponse requester new Requester CommandRequest CommandResponse gt new RequesterParams participant CommandRequestTypeSupport get instance CommandResponseTypeSupport get instance SetRequestTopicName COMMAND TOPIC SetReplyTopicName RESPONSE TOPIC DataWriterQos writerQos new DataWriterQos requester getRequestDataWriter get qos writerQos System out println rel writerQos reliability kind try System out println Waiting to discover Routing Service InstanceHandleSeq handles new InstanceHandleSeq 5 10 5 3 Accessing Routing Service from a Connext Application while handles isEmpty requester getRequestDataWriter get matched subscriptions handles Thread sleep 200 System out println Matched subscription Send DISABLE command WriteSample lt CommandRequest gt request requester CreateRequestSample requ
137. ice 4 2e This option should be used when compatibility with 4 2e is required and the topic data types contain double long long unsigned long long or long double members Default Disabled verbosity n Controls what type of messages are logged 0 Silent 1 Exceptions Connext and Routing Service default 2 Warnings Routing Service 3 Information Routing Service 4 Warnings Connext and Routing Service 5 Tracing Routing Service 6 Tracing Connext and Routing Service Each verbosity level n includes all the verbosity levels smaller than n version Prints the Routing Service version number Chapter 4 Transforming Data with Routing Service As described in Data Transformation Section 2 4 6 5 a route can transform the incoming data using a transformation which is an object created by a transformation plugin Transformation plugins implement the transformation API and must be provided as shared libraries that Routing Service will load dynamically Currently the transformation plugin API is only supported in C This chapter describes 1 Transformation Usage and Configuration Section 4 1 1 Transformations Distributed with Routing Service Section 4 2 N Creating New Transformations Section 4 3 4 1 Transformation Usage and Configuration In the XML configuration file transformation plugins must be defined within a transformation library For example lt
138. ile on UNIX based systems create two directories called input and output 3 In the input directory create a file called HelloWorld txt with the following content Hello World 1 Hello World 2 Hello World 3 Hello World 4 1 Your directory may be different if you did not use the default locations 8 52 8 3 Creating New Adapters Hello World 5 Hello World 6 Hello World 7 Hello World 8 Hello World 9 Hello World 10 4 In the adapter project directory create a Routing Service XML configuration file called simple_file_adapter xml with the following content Replace the value of the directory property under both connections with the location of the input and output directories lt xml version 1 0 gt lt dds gt lt adapter library name adapters gt java adapter plugin name simple file class name gt routingservice adapter simplefile SimpleFileAdapter lt class name java adapter plugin adapter library types struct name TextLine gt member name value type string stringMaxLength 2048 gt struct types routing service name file to file lt jvm gt class path lt element gt class simplefileadapter jar lt element gt lt class_path gt lt jvm gt lt domain_route name domain_route gt connection 1 plugin name adapters simple file gt registered type name TextLine type name TextLine gt property value element lt na
139. implefile SimpleFil eAdapter lt init gt line 23 bci 0 23 public SimpleFileAdapter Properties props Use the command help to get a list of the command that will allow you to continue the debugging process 8 56 8 3 Creating New Adapters 8 3 7 3 Debugging with NetBeans NetBeans is an IDE for developing and debugging Java applications This section is not intended to give complete coverage of all the NetBeans debugger functionality but rather to provide basic information on how to attach the NetBeans debugger to the Routing Service JVM and start debugging 1 Verify that NetBeans IDE 6 9 is installed on your system The installation of NetBeans is beyond the scope of this document please refer to NetBeans documentation 2 Start NetBeans 3 Make the adapter source code available to the debugger a Select Window Debugging Sources b Right click the Remote Attach window and select Add Source Root c Enter the adapter directory Selected Project Source Root v C adapters SimpleFileAdapter 8 3 Creating New Adapters 4 Set breakpoints in the methods or classes that you would like to debug For example to set a breakpoint in the SimpleFileAdapter constructor follow the follow ing steps a Select Debug New Breakpoint b In the New Breakpoint window select Method as the breakpoint type and provide routingservice adapter simplefile SimpleFileAdapter as the class name and init as th
140. ing SQL filter conf Discovery of a DataReader with no filter or with F a non SQL filter conf All pass Remote Administration You can enable or disable filter propagation on a particular route by means of remote adminis tration see Chapter 5 Administering Routing Service from a Remote Location To enable or disable filter propagation you can send a configuration update with the new state of the func tionality For instance the XML snippet needed to enable filter propagation is as follows 9 4 9 3 Restrictions 9 3 lt topic_route gt lt filter propagation gt true lt filter propagation gt lt topic_route gt Enabling filter propagation remotely will fail if the route is enabled and started the Stream Reader is created with filter propagation disabled In this situation the route needs to be dis abled before enabling filter propagation and re enable it again afterwards Restrictions Filter propagation cannot be enabled when I Using routes or auto routes since they are meant to work with other adapters different than the built in DDS one I A transformation is set in the topic route 1 Using remote administration if the topic route was enabled and started with the func tionality initially disabled Filter propagation only works with the DDS built in SOL filter it cannot be configured with other filter classes 9 5
141. ingServiceEnvironment env free adapter struct RTI RoutingServiceAdapterPlugin adapter NULL struct RTI RoutingServiceVersion version 1 0 0 0 int verbosity verbosity RTI RoutingServiceEnvironment get verbosity env if verbosity RTI ROUTING SERVICE VERBOSITY DEBUG printf CALL SimpleFileAdapter_create n adapter calloc 1 sizeof struct RTI_RoutingServiceAdapterPlugin if adapter NULL RTI_RoutingServiceEnvironment_set_error env Memory allocation error return NULL RTI RoutingServiceAdapterPlugin initialize adapter adapter plugin version version Assign the function pointers El adapter gt adapter plugin delete SimpleFileAdapter delete return struct RTI_RoutingServiceAdapterPlugin adapter The structure RTI_RoutingServiceAdapterPlugin contains the plugin implementation as a set of function pointers For now you only need to implement adapter_plugin_delete that deletes the plugin instances created by SimpleFileAdapter_create You will initialize the other pointers in the plugin structure as you implement the adapter functionality The entry point function receives two parameters the adapter properties and the environment env The properties parameter not used by the SimpleFileAdapter is used to configure the adapter instance The values contained in this parameter are provided as name value pairs using the 8 21 8 3 Creating New Adapte
142. ion adapter plugin adapter library types struct name TextLine gt member name value type string stringMaxLength 2048 gt struct types routing service name file to file gt domain route name domain_route gt connection 1 plugin name adapters simple file registered type name TextLine type name TextLine gt property value element lt name gt directory lt name gt lt value gt c adapters SimpleFileAdapter input lt value gt lt element gt lt value gt lt property gt connection 1 connection 2 plugin name adapters simple file registered type name TextLine type name TextLine gt property value element lt name gt directory lt name gt lt value gt c adapters SimpleFileAdapter output lt value gt lt element gt lt value gt lt property gt connection 2 session name session gt route name route gt input connection 1 gt stream name HelloWorld stream name registered type name gt TextLine lt registered type name input output stream name HelloWorld stream name 8 34 8 3 Creating New Adapters registered type name gt TextLine lt registered type name gt lt property gt lt value gt lt element gt name print to stdout name lt value gt 1 lt value gt lt element gt lt value gt lt property gt lt output gt lt route gt lt sess
143. ion about the Java API please see the online HTML Routing Service docu mentation The Java Adapter API defines the interfaces in Table 8 10 Adapter Entry Point Every Java adapter must create an Adapter class that implements the com rti routingser vice adapter Adapter interface Adapter classes are registered with Routing Service using the tag class name within java adapter plugin see Section 8 1 When Routing Service creates a new adapter object it will look for the following constructor MyAdapter java utils Properties properties 8 37 8 3 Creating New Adapters Table 8 10 Java Adapter API Interfaces 8 3 5 2 8 3 5 3 Interface Description com rti routingservice adapter Adapter Required The Adapter interface defines methods to get the adapter version create destroy connections com rti routingservice adapter Connection Required The Connection interface defines methods to create destroy Sessions create destroy StreamReaders create destroy StreamWriters update the Connection configuration com rti routingservice adapter DiscoveryConnection The DiscoveryConnection interface defines methods to get the discovery StreamReaders see Section 8 2 2 copy delete TypeRepresentations com rti routingservice adapter Session Required The Session interface defines methods to update the Session configuration com rti routingservice adapter StreamRea
144. ion gt lt domain_route gt routing service dds 5 Start Routing Service by entering the following in a command shell On UNIX based systems cd SimpleFileAdapter project directory gt SROUTINGSERVICEHOME scripts rtiroutingservice cfgFile simple file adapter xml cfgName file to file On Windows systems cd SimpleFileAdapter project directory gt SROUTINGSERVICEHOME S scripts rtiroutingservice cfgFile simple file adapter xml cfgName file to file 6 On the screen you will see RTI Routing Service lt version gt started with name file to file Hello World 1 Hello World 2 Hello World 3 Hello World 4 Hello World 5 Hello World 6 Hello World 7 Hello World 8 Hello World 9 Hello World 10 7 Verify that a file called HelloWorld txt has been generated into the output directory The content of this file should de identical to the content of the same file in the input direc tory 8 3 4 Debugging C Adapters When you develop a custom adapter you will need to debug it and test it This section talks about the tools and APIs that you have available to debug and detect problems in Routing Service adapters written in C The first debugging capability is provided by the Routing Service SDK The adapter SDK pro vides a way to access the verbosity level of Routing Service through the usage of the environment function RTI RoutingServiceEnvironment get verbosity It is highly recommendable t
145. ions e g TypeCode associated with the input and output streams are available If a route refers to types that are not defined in the configuration file Routing Service has to dis cover their type representation e g TypeCode before creating StreamReaders and StreamWrit ers The adapter discovery API is used to provide stream and type information in a data domain to Routing Service The discovery API consists of four methods 8 8 8 2 Adapter API And Entity Model 8 2 3 L Connection get_input_stream_discovery_reader 1 Connection get_output_stream_discovery_reader L Connection copy_type_representation 1 Connection delete_type_representation The first two methods provide access to StreamReaders used to discover streams in the data domain associated with a connection The input StreamReader get_input_stream_discovery_reader provides information about input streams An input stream is a stream from which a StreamReader read data Disposed sce narios where an input stream disappears are also notified using the input StreamReader In the builtin DDS adapter the input StreamReader is associated with the publication built in DataReader of the DomainParticipant The output StreamReader get_output_stream_discovery_reader provides information about output streams An output stream is a stream to which StreamWriters can write data Disposed scenarios where an output stream disappears are also notifi
146. is one property called directory that is used to specify the directory containing the files to read write For example connection 1 plugin name adapters simple file gt registered type name TextLine type name TextLine gt property value element lt name gt directory lt name gt lt value gt tmp SimpleFileAdapter input lt value gt lt element gt lt value gt lt property gt lt connection_1 gt Connection objects are factories for Session StreamReader and StreamWriter objects In the next sections you will implement StreamReader and StreamWriters Session objects are not used in this example Implementing the StreamReader Class A StreamReader provides a way to read data samples of a specific type from a data domain In the configuration file StreamReaders are associated with the tag lt input gt within lt route gt or lt auto_route gt see Section 2 4 6 The StreamReaders created by the SimpleFileAdapter connections read text files from the con nection directory The data samples provided to Routing Service using the read operation are DynamicData with the following IDL type struct TextLine string lt 1024 gt value When a SimpleFileAdapter StreamReader is created the name of the file is the input stream name with a txt extension The frequency at which the StreamReader notifies Routing Service of new lines is configurable using the read_period property For example lt rou
147. is configuration The contents of this tag are specified in the same manner as for a Connext datareader qos datawriter qos QoS profile file see Chapter 15 in 0 or 1 the RTI Core Libraries and Utilities User s Manual If the tag is not defined Routing Ser vice will use the Connext defaults A registered type name filter that should be denied excluded This is applied after allow registered type name filt deny registered type name filter er Oor1 You may use a comma separated list to specify more than one filter Default Not applied 2 35 2 5 Enabling and Disabling Routing Service Entities Table 2 19 Connext Input and Output Tags for the lt auto_topic_route gt and lt auto_route gt Tags Tags within Tags within Number lt auto_topic_route gt lt input gt lt auto_topic_route gt lt output gt Description of Tags and and lt auto_route gt lt dds_input gt lt auto_route gt lt dds_output gt allowed A topic name filter that should be denied excluded This is applied after the lt deny_topic_name_filter gt lt allow_topic_name_filter gt Dor1 You may use a comma separated list to specify more than one filter Default Not applied 1 As defined by the POSIX fnmatch API 1003 2 1992 section B 6 2 See Connext installation directory ndds lt version gt doc pdf RTI_CoreLibrariesAndUtilities_UsersManual pdf To support n
148. istration and sets the domain ID for remote communication For more information about the command line options see Starting Routing Service Section 3 1 When remote administration is enabled Routing Service will create a DomainParticipant Pub lisher Subscriber DataWriter and DataReader in the designated domain The QoS values for these entities are described in Section 2 4 3 5 1 5 2 Remote Commands 5 2 Remote Commands This section describes the remote commands using the shell interface Section 5 3 explains how to use remote administration from a Connext application Remote commands add peer lt target_routing_service gt domain route name p1 p2 peer list create target routing service domain route session topic routelauto route parent entity name xml url remote local e delete target routing service lt entity_name gt e disable lt target_routing_service gt lt entity_name gt e enable lt target_routing_service gt lt entity_name gt get target routing service e load target routing service cfg name xml url remote local pause target routing service entity name resume target routing service entity name save target routing service update target routing service entity name lt xml_url gt lt assignment_expr gt remote local Parameters I lt assignment_expr gt can be used instead of l
149. le foo pem 512 bar pem 256 means dh param files 0 file foo pem dh param files 0 bits 512 dh param files 1 file bar pem dh param files 1 bits 256 tls cipher engine id String ID of OpenSSL cipher engine to request tls identity certificate_chain A string containing an identifying certificate chain in PEM format An identifying certificate is required for secure communication The string must be sorted starting with the certificate to the highest level root CA Either certificate_chain or certificate_chain_file is required You must set exactly one of these Do not set both of them this would produce a configuration error tls identity certificate_chain_file A string that specifies the name of a file containing an identifying certificate chain in PEM format An identifying certificate is required for secure communication The file must be sorted starting with the certificate to the highest level root CA Optionally a private key may be appended to this file If a private key is not appended to this file then either private_key or private_key_file is required Either certificate_chain or certificate_chain_file is required You must set exactly ONE of these Do not set both of them this would produce a configuration error tls identity private_key_password A string that specifies the password for private key tls identity private_key A string containing a private key in PEM fo
150. le gt lt property gt lt value gt lt element gt lt value gt lt property gt lt connection_2 gt lt domain_route gt 6 create_session eR create Session session name session property lt value gt element 8 create session Nalue E property 9 createl Session session 10 create stream reader route name route gt acalel J StreamReader lt input connection 1 gt lt property gt ads 12 create stream writer create StreamWriter lt Nalue gt StreamWriter lt property gt lt finput gt lt output gt lt property gt L lt value gt lt element gt Nalue lt property gt lt output gt lt route gt L An Adapter object is created when the first domain route that refers to it is enabled J A Connection object is created when the domain route domain route that contain it is enabled 21 A Session object is created when the associated routing service session session is enabled LJ A route s StreamReader is created when the route is enabled and the creation mode con dition associated with the input tag becomes true see Section 2 4 6 4 LJ A route s StreamWriter is created when the route is enabled and the creation mode con dition associated with the output tag becomes true see Section 2 4 6 4 8 2 2 Stream Discovery A route cannot forward data until the type representat
151. le Java adapter on Windows and UNIX based architec tures It is not intended to give complete coverage of the entire adapter API but rather to intro duce the adapter technology and provide the basics of the development process of a Java adapter The new Adapter will be a simple file adapter where the input adapter reads lines from a text file and the output adapter saves the provided lines to an output text file The source code and scripts that you will create in the next sections are provided in lt Routing Service home gt adapters tutorial Java Setting the Environment on the Development Machine There are a few things to take care of before you start developing the simple file adapter 1 Set the environment variable ROUTINGSERVICEHOME Set the environment variable ROUTINGSERVICEHOME to the Routing Service installa tion directory Routing Service itself does not require that you set the environment vari able It is used to build compile and run the example adapter 2 On Windows Systems To use a Java adapter you must have the Visual Studio 2005 ser vice pack 1 redistributable libraries You can obtain this package from Microsoft or RTI see the RTI Core Libraries and Utilities Release Notes for details 3 Make sure Java 1 5 or higher is available Ensure that appropriate javac jar and jdb for debugging executables are on your path They can be found in the bin directory of your JDK installation 4 Make sure you add
152. le QoS policies in For DDS adapter Immutable QoS policies in SERSIDE publisher qos and subscriber qos publisher qos and subscriber qos entity monitoring enabled entity monitoring statistics sampling period entity monitoring status publication period entity monitoring historical statistics Mutable properties in lt property gt adapter specific gp c ders in property Route Mutable properties in Immutable properties in transformation lt property gt ies lt transf tion gt lt ty gt transformation specific ransformation gt lt property transformation specific 5 6 5 2 Remote Commands Table 5 1 Changeable Parameters Entity Mutable Immutable changeable any time only changeable when entity is disabled Mutable QoS policies in datawriter qos and datareader qos Mutable properties in transformation property Immutable QoS policies in datawriter qos and transformation specific datareader qos Topic route types creation mode Route Propagate dispose content filter expression propagate unregister entity monitoring statistics sampling period publish with original info entity monitoring historical statistics content filter parameter entity monitoring enabled entity monitoring status publication period d Mutable properties in
153. ling on each allocation until it reaches max count control message allocation Allocation settings applied to control messages These settings configure the initial number of messages the maximum number of mes sages and the messages to be allocated when more messages are needed Default LJ control message allocation initial count 2 1 control message allocation max count 1 unlimited I control message allocation incremental count 1 number of messages will keep doubling on each allocation until it reaches max count control attribute allocation Allocation settings applied to control messages attributes These settings configure the initial number of attributes the maximum number of attri butes and the attributes to be allocated when more attributes are needed Default control attribute allocation initial count 2 J control attribute allocation max count 1 unlimited J control attribute allocation incremental count 1 number of attributes will keep doubling on each allocation until it reaches max count 7 11 7 2 Configuring the TCP Transport Table 7 1 TCP TLS Transport Properties over LAN or WAN NDDS_Transport_TCPv4_Property_t Property Name prefix with rr dds transport TCPv4 Description tcp1 force asynchronous send Forces an asynchronous send When this parameter is set to 0 the TCP transport will attempt to send data as soon as the inte
154. llowed lt statistics_sampling_ period gt Specifies the frequency at which status statistics are gathered Statistical variables such as latency are part of the entity status For example lt statistics sampling period gt lt sec gt 1 lt sec gt lt nanosec gt 0 lt nanosec gt lt statistics sampling period The statistics period for a given entity should be smaller than the publi cation period If the tag is not defined the period is inherited from the general moni toring settings This tag is only present in the entity monitoring tag of route topic route auto route auto topic route and routing service Oor1 status publication period Specifies the frequency at which the status of an entity is published For example status publication period gt lt sec gt 3 lt sec gt lt nanosec gt 0 lt nanosec gt lt status_publication_period gt If the tag is not defined its value is inherited from the general monitor ing settings Oor1 Session A session tag defines a single threaded context for data routing The data is routed according to specified routes Section 2 4 6 and auto routes Section 2 4 7 Each session will have an associated session thread that will serialize access to the routes in the session For example lt dds gt routing service name MyRoutingService gt lt domain_route gt session name Sessionl gt lt
155. lt property gt adapter specific uum In property Immutable QoS policies in datawriter qos and Mutable QoS policies in datawriter qos and datareader qos datareader qos creation mode propagate dispose allow topic name filter Auto propagate unregister allow registered type name filter E publish with original info deny topic name filter content filter parameter deny registered type name filter entity monitoring enabled content filter expression entity monitoring status publication period entity monitoring statistics sampling period entity monitoring historical statistics 1 Monitoring parameters can also be changed when monitoring is disabled even when the entity is enabled If you try to change an immutable parameter in an entity that is enabled you will receive an error message To change an immutable parameter you must disable the routing service entity change the parameter and then enable the routing service entity again You can send an XML snippet or an assignment expression that only contains the values you want to change for that entity or you can send a whole well formed configuration file 1 If you send an XML snippet or an assignment expression only the changes you specify will take effect For example suppose you send this command update ShapeRouter DomainRoutel Sessionl SquareToCircles str
156. m writer RTI RoutingServiceEnvironment env struct SimpleFileAdapterStreamWriter writer struct SimpleFileAdapterStreamWriter stream writer int verbosity 8 31 8 3 Creating New Adapters verbosity RTI_RoutingServiceEnvironment_get_verbosity env if verbosity RTI_ROUTING SERVICE VERBOSITY DEBUG printf CALL SimpleFileAdapterConnection delete stream _writer n if writer gt fHandle fclose writer gt fHandle free writer Creates a StreamWriter RTI RoutingServiceStreamWriter SimpleFileAdapterConnection create stream writer RTI RoutingServiceConnection connection RTI RoutingServiceSession session const struct RTI RoutingServiceStreamInfo stream info const struct RTI RoutingServiceProperties properties RTI RoutingServiceEnvironment env const char printToStdoutStr char file struct SimpleFileAdapterConnection self struct SimpleFileAdapterConnection connection struct SimpleFileAdapterStreamWriter writer NULL int verbosity verbosity RTI RoutingServiceEnvironment get verbosity env if verbosity RTI ROUTING SERVICE VERBOSITY DEBUG printf CALL SimpleFileAdapterConnection create stream _writer n Create StreamWriter writer calloc 1 sizeof struct SimpleFileAdapterStreamWriter if writer NULL RTI_RoutingServiceEnvironment_set_error env Memory allocation error return NULL Open output file
157. mand or other remote commands that change the configuration such as add peer However the retrieved configuration may not be textually equivalent For example the retrieved configuration may explicitly contain default values that were not in the initial XML load load target routing service cfg name xml url remote 1ocal The load command loads specific XML configuration code The target routing service must be disabled For more information see How to Load the XML Configuration Section 2 2 The XML code received must represent a valid routing service configuration file The name of the routing service tag to load is identified with cfg name pause pause target routing service entity name gt When the pause command is called in a route the session thread containing this route will stop reading data from the route s StreamReader For routing service domain routes auto routes and auto topic routes the execution of this com mand will pause the contained topic routes and routes resume resume target routing service entity name gt When the resume command is called in a route the session thread containing this route will con tinue reading data from the route s StreamReader For routing service domain routes auto routes and auto topic routes the execution of this com mand will resume the contained topic routes and routes save Save target routing service This command writes the cu
158. me any topic of type ShapeType is discovered on the DDS domain or a JMS queue topic starting with A with a type starting with B is discovered on the output JMS connection For example discovering the topic Triangle of ShapeType will trigger the creation of a topic route that routes triangles from the DDS domain to the JMS domain Discovering a topic Atopic of type Btype on the JMS domain will trigger the creation of a topic route that routes Atopic from the DDS domain to the JMS domain DDS inputs and outputs within an auto route are defined using the XML tags lt dds_input gt and lt dds_output gt Input and outputs from other data domains are defined using the tags lt input gt and lt output gt An auto topic route is a special kind of route that defines a mapping between two DDS domains Please see the following tables for more information on allowable tags Table 2 16 on page 2 32 lists the tags allowed within an auto route tag l Table 2 17 on page 2 33 lists the tags allowed within an auto topic route tag l Table 2 18 on page 2 33 lists the tags allowed within input and output tags nested within an lt auto_route gt tag l Table 2 19 on page 2 35 lists the tags allowed within the dds input and lt dds_output gt tags nested within an lt auto_topic_route gt or a lt topic_route gt tag Table 2 16 Auto Route Tags D Number of Ee diede Description Tags E Allowed
159. me gt directory lt name gt lt value gt opt adapters simplefile input lt value gt lt element gt lt value gt lt property gt connection 1 connection 2 plugin name adapters simple file registered type name TextLine type name TextLine gt property value element lt name gt directory lt name gt lt value gt opt adapters simplefile output lt value gt lt element gt lt value gt lt property gt connection 2 session name session gt route name route gt input connection 1 gt 8 53 8 3 Creating New Adapters lt stream_name gt HelloWorld lt stream_name gt registered type name gt TextLine registered type name input output stream name HelloWorld stream name registered type name TextLine registered type name gt property value element name print to stdout name lt value gt 1 lt value gt lt element gt lt value gt lt property gt lt output gt lt route gt lt session gt lt domain_route gt lt routing_service gt lt dds gt 5 Start Routing Service by entering the following in a command shell On UNIX based systems gt cd lt SimpleFileAdapter project directory gt gt SROUTINGSERVICEHOME scripts rtiroutingservice cfgFile simple file adapter xml cfgName file to file On Windows systems gt cd lt SimpleFileAdapter project directory gt gt SROUTINGSERVICEH
160. me using the command line parameter appName If appName is not used the routing service tag name provided with cfgName is used If you use identi fyExecution the host name and process ID are appended to the name For example RTI RoutingService myhost 1234 Name of the group to which the routing service belongs Routing services in the same group will not communicate with each other group name The group name is assigned using the attribute group name in the routing service tag If the attribute is not defined the group name is automati cally set to RTI RoutingService Host Name Process ID host name Name of the host where the routing service is running host id Identifies the host where the routing service instance is running app id Process task ID of the routing service instance proper as Specifies the file that will contain the saved configuration administration A boolean that if true automatically triggers a save command when configuration auto_save_on_update updates are received Routing Service data samples are published when The routing service instance is enabled 1 The routing service instance is disabled dispose sample E Monitoring is enabled via remote administration 6 3 6 2 Monitoring Configuration Data 6 2 2 Table 6 2 Configuration Data for a Domain Route The topic that publishes domain route configuration data is called rti routing_servi
161. mically load the TCP transport library at run time and then implicitly create and register the transport plugin with Connext TCP Transport Initial Peers With the TCP transport the addresses of the initial peers NDDS_DISCOVERY_PEERS that will be contacted during the discovery process have the following format For WAN communication tcpv4 wan IP address or hostname gt lt port gt For LAN communication tcpv4 lan IP address or hostname gt lt port gt For WAN TLS communication tlsv4 wan IP address or hostname gt port For LAN TLS communication tlsv4 lan IP address or hostname gt port For example setenv NDDS DISCOVERY PEERS tcpv4 wan 10 10 1 165 7400 tcpv4 wan 10 10 1 111 7400 tcpv4 lan 192 168 1 1 7500 When the TCP transport is configured for LAN communication with the parent classid prop erty the IP address is the LAN address of the peer and the port is the server port used by the transport the server bind port property When the TCP transport is configured for WAN communication with the parent classid prop erty the IP address is the WAN or public address of the peer and the port is the public port that is used to forward traffic to the server port in the TCP transport When TLS is enabled the transport settings are similar to WAN and LAN over TCP Setting Up the TCP Transport Properties with the PropertyQoSPolicy The PropertyQosPolicy allows you to set up name value pairs of data and attac
162. n about the output bytes per second in routes Output bytes refer to the bytes that are published out by the session thread using the route s StreamWriter The variable only considers the bytes of the serialized samples Pro tocol headers UDP RTPS are not included Statistic variable that provides information about the latency in seconds in the routes output_bytes_per_s latency_s The latency in a route refers to the time elapsed between the sample read and write This is a good metric to monitor the health and performance of transformations 6 3 6 Status Information for an Auto Route The topic that publishes auto route status is called rti routing service monitoring route status set The auto route status aggregates the statistics of the routes created from it the mean of the means in the routes the absolute maximum and minimum across routes the mean of the stan dard deviation and the total count The IDL definition of the data type is struct AutoRouteStatusSet string lt ENTITY NAME MAX LENGTH routing service name key string lt ENTITY NAME MAX LENGTH domain route name key string lt ENTITY NAME MAX LENGTH session name Gkey string lt ENTITY NAME MAX LENGTH name key StatisticVariable input samples per s StatisticVariable input bytes per s StatisticVariable output samples per s StatisticVariable output bytes per s StatisticVariable latency s s Table 6 10 describes the fields
163. n and the total count The IDL definition of the data type is struct DomainRouteStatusSet string lt ENTITY_NAME MAX LENGTH routing service name key string lt ENTITY NAME MAX LENGTH name key StatisticVariable StatisticVariable StatisticVariable StatisticVariable StatisticVariable input samples per s input bytes per output samples per s output bytes per s latency s y Table 6 7 describes the fields in the DomainRouteStatusSet data type DomainRouteStatusSet Field Name Description routing_service_name Key field The routing service name assigned with appName name input samples per s Key field The domain route name configured using the name attribute in the domain route tag Statistic variable that provides information about the input samples per second across routes Input samples refer to the samples that are taken by the sessions from the routes s Stream Readers input bytes per s Statistic variable that provides information about the input bytes per second across routes Input bytes refer to the bytes that are taken by the sessions from the routes s StreamRead ers These bytes only refer to the serialized samples The protocol headers UDP RTPS are not included output samples per s Statistic variable that provides information about the output samples per second across routes Output samples refer to the samples that are published out by
164. n_ Description of Tags plugin gt Allowed Shared library containing the implementation of the transformation plugin The lt dll gt tag may specify the exact name of the file for example lib lib mytransformation so or a general name no file extension which will be completed as follows lt dll gt value dir mytransformation Final Path UNIX based systems dir libmytransformation so 1 Final Path Windows systems dir mytransformation dll required If the library specified with the dll tag cannot be opened because the library path is not in the Path environment variable on Windows or the LD_LIBRARY_PATH environment variables on UNIX based systems Routing Service will look for the library in lt Routing Service installation directory bin architecture dll This tag will contain the name of the function used to create the transfor 1 create function mation plugin see Section 4 3 1 The function must be implemented in the shared library required 4 2 4 2 Transformations Distributed with Routing Service Table 4 2 Transformation Tags Tags within lt transformation gt Number Description of Tags Allowed lt property gt Sequence of name value string pairs that can be used to configure the parameters of the transformation For example lt property gt lt value gt lt element gt lt name gt X lt name gt lt value gt Y lt value gt lt eleme
165. nfiguration publish with When this tag is set to true the data samples are written with their Dori original timestamp original source timestamp Default false Table 2 18 Input and Output Tags for the auto route Tag blica sins Number Tags within Tags within Description of Tags input output Allowed A registered type name filter allow registered type name filter You may use a comma separated list to specify more iced than one filter Default allow all A stream name filter ls mame Hikers You may use a comma separated list to specify more Gent than one filter Default allow all The routes are created with this configuration See Cre lt creation_mode gt ation Modes Controlling when StreamReaders and 0 or 1 StreamWriters are Created Section 2 4 6 4 2 33 2 4 XML Tags for Configuring Routing Service Table 2 18 2 4 8 Input and Output Tags for the lt auto_route gt Tag T in Number Tags within Tags within P ds Description of Tags lt input gt lt output gt Allowed The topic routes are created with this configuration The contents of this tag are specified in the same man ner as for a Connext QoS profile file see Chapter 15 in sHatarender qose lt datawaiter_qos gt the RTI Core Libraries and Utilities User s Manual Ho If the tag is not defined Routing Service will use the Connext defaults A registered type name filter that should be denied
166. nfigured with its public address so that this information can be propagated as part of the discovery process 7 2 7 1 TCP Communication Scenarios Figure 7 3 Symmetric Communication across NATs n parent classid Participant NDDS TRANSPORT TCPv4 Transport CLASSID TCPV4 WAN IP address public address 1927168 1 T1 18 181 0 31 8400 server bind port 7400 Initial Peers 1 18 181 0 32 8500 az Connection Data NAT Router WAN IP address 18 181 0 31 Public Server Bind Port 8400 Portforward settings WAN port 8400 to 192 168 1 11 7400 parent classid Participant NDDS_TRANSPORT_ TCPv4 Transport CLASSID_TCPV4_WAN IP address public_address 192 168 5 11 18 181 0 32 8500 server_bind_port 7400 Initial Peers 18 181 0 31 8400 Ey NAT Router WAN IP address 18 181 0 32 Public Server Bind Port 8500 Portforward settings WAN port 8500 to 192 168 5 11 7400 Because the public address and port of the Routing Service instances must be known before the communication is established the NAT Routers will have to be configured statically to translate forward the private server_bind_port into a public port This process is known as static NAT or port forwarding and it allows traffic originating in outer networks to reach desig nated peers in the LAN behind the NAT router 7 1 3 Asymmetric Communication Across NATs This scenario is similar to the previous one e
167. ng Service 1 It can significantly reduce the time and effort spent integrating and scaling Connext applications across Wide Area Networks and Systems of Systems Many systems today already rely on Connext to distribute their information across a Local Area Network LAN However more and more of these systems are being inte grated in Wide Area Networks WANs With Routing Service you can scale Connext real time publish subscribe data distribution beyond the current local networks and make it available throughout a WAN without making any changes to existing Connext applica tions You can take an existing even deployed system and integrate it with new applica tions or other existing systems without changing those existing systems _ With Routing Service you can build modular systems out of existing systems Data can be contained in private domains within subsystems and you can designate that only cer tain global topics can be seen across domains The same mechanism controls the scope 1 1 of discovery Both application level and discovery traffic can be scoped facilitating scal able designs L Routing Service provides secure deployment across multiple sites You can partition networks and protect them with firewalls and NATS and precisely control the flow of data between the network segments 1 It allows you to manage the evolution of your data model at the subsystem level You can use Routing Service to transform data on
168. nsume and produce data for different data domains e g DDS JMS Socket etc By default Routing Service is distributed with a builtin DDS adapter Any other adapters must be registered within the lt adapter_library gt tag 2 34 2 4 XML Tags for Configuring Routing Service Table 2 19 Connext Input and Output Tags for the lt auto_topic_route gt and lt auto_route gt Tags Tags within Tags within Number lt auto_topic_route gt lt input gt lt auto_topic_route gt lt output gt Description of Tags and and lt auto_route gt lt dds_input gt lt auto_route gt lt dds_output gt allowed A registered type name filter You may use a comma separated list to specify more than one filter Default allow all A topic name filter allow registered type name filter Oor1 You may use a comma separated list to specify more than one filter Default allow all The topic routes are created with a SOL content filter topic with this expression allow topic name filter Oor1 auto topic route input content filter N A content filter 0 or1 expression x amp gt 100 expression content filter input auto topic route The topic routes are created with this configuration See Creation creation mode Modes Controlling when Stream 0 or 1 Readers and StreamWriters are Cre ated Section 2 4 6 4 The topic routes are created with th
169. nt The adapt ers can access this information with the following function void RTI RoutingServiceEnvironment get version const RTI RoutingServiceEnvironment self struct RTI RoutingServiceVersion version 8 13 8 3 Creating New Adapters 8 3 3 8 3 3 1 8 3 3 2 My First C Adapter This section shows how to create a simple C adapter on Windows and UNIX based systems It is not intended to give complete coverage of the entire adapter API but rather to introduce the adapter technology and provide the basic process for developing a C adapter The new Adapter will be a simple file adapter where the input adapter reads lines from a text file and the output adapter saves the provided lines to an output text file A more flexible and complex file adapter that is able to work with structured information is pro vided under lt Routing Service home gt adapters file The source code and projects that you will create in the next sections are provided in lt Routing Service home gt adapters tutorial C Setting the Environment on the Development Machine There are a few things to take care of before you start developing the simple file adapter 1 Install Connext see the Routing Service Release Notes for the compatible version of Connext The C adapter will use TypeCode as the type representation format and DynamicData as the data representation format This will require linking against the Connext libraries and including the
170. nt entities is composed primarily of statistics Section 6 3 1 explains how these statistics are calculated and published These sections describe the status information associated with each kind of entity J Status Information for the Routing Service Section 6 3 2 1 Domain Route Status Section 6 3 3 J Status Information for a Session Section 6 3 4 LJ Status Information for a Route Section 6 3 5 LJ Status Information for an Auto Route Section 6 3 6 Each section describes the IDL for the topics underlying data types The IDL is also in the file Routing Service installation directory gt resource idl RoutingServiceMonitoring idl How the Statistics are Generated Statistics Publication Routing Service reports multiple statistics as part of the different status sets For example for a route the status contains statistical metrics about the input and output samples per second throughput struct RouteStatusSet StatisticVariable input samples per s StatisticVariable output samples per s 6 14 6 3 Monitoring Status 6 3 1 2 a The statistical information is published periodically in the form Statistic Variables The period at which statistics are published is configurable using the tag lt status_publication_ period gt see Section 2 4 4 For a given variable Routing Service computes the metrics in StatisticMetrics during specific time frames struct StatisticMetrics unsigned long long period_ms
171. nt gt lt element gt Oorl lt name gt Y lt name gt lt value gt X lt value gt lt element gt lt value gt lt property gt In this example the properties are used to define the field assignments The semantics associated with the transformation property value depends on the plugin implementation 4 2 Transformations Distributed with Routing Service Routing Service provides a transformation that is able to map fields of the input type to fields of the output type using the property tag inside the transformation to provide this mapping For example lt dds gt lt transformation library name TransformationLib gt lt transformation plugin name Assignment gt lt dll gt rtirsassigntransf lt dll gt create function gt RTI_RoutingServiceAssignTransformationPlugin create create function transformation plugin transformation library routing service name MyService domain route name MyDomainRoute gt session name MySession route name MyRoute gt transformation plugin_name TransformationLib Assignment gt lt property gt lt value gt lt element gt lt name gt X lt name gt lt value gt Y lt value gt lt element gt lt element gt lt name gt Y lt name gt lt value gt X lt value gt 4 3 4 3 Creating New Transformations 4 3 lt element gt lt value gt lt property gt lt transformation gt lt route gt Jesi
172. of interface addresses that can be used by the transport Interfaces must be specified as comma separated strings with each comma delimiting an interface For example 10 10 10 15 If the list is non empty this white list is applied before parent deny_interfaces_list Default All available interfaces are used parent deny_interfaces_list A list of strings each identifying a range of interface addresses that will not be used by the transport If the list is non empty deny the use of these interfaces Interfaces must be specified as comma separated strings with each comma delimiting an interface For example 10 10 This black list is applied after parent allow_interfaces_list and filters out the inter faces that should not be used Default No interfaces are denied send_socket_buffer_size Size in bytes of the send buffer of a socket used for sending On most operating sys tems setsockopt will be called to set the SENDBUF to the value of this parameter This value must be greater than or equal to parent message_size_max or 1 The maximum value is operating system dependent Default 1 setsockopt or equivalent will not be called to size the send buffer of the socket 7 8 7 2 Configuring the TCP Transport Table 7 1 TCP TLS Transport Properties over LAN or WAN NDDS_Transport_TCPv4_Property_t Property Name prefix with tcp1 dds transport TCPv
173. omain and an output stream in the other domain For example in a route between DDS and JMS the input stream will be a DDS topic and the output stream will be a JMS topic or queue 1 An auto route defines a set of potential routes that can be instantiated based on deny allow filters on the stream name and registered type name I A transformation is a pluggable component that changes data from the input stream A to data in the output stream B 2 1 2 2 How to Load the XML Configuration L An adapter is a pluggable component that allows Routing Service to consume and produce data for different data domains By default Routing Service is distributed with a builtin DDS adapter 2 2 How to Load the XML Configuration Routing Service loads its XML configuration from multiple locations This section presents the various approaches listed in load order The first three locations only contain QoS Profiles and are inherited from Connext see Chapter 15 in the RTI Core Libraries and Utilities User s Manual I NDDSHOME resource qos_profiles_5 x y xml NDDS_QOS_PROFILES xml This file contains the Connext default QoS values it is loaded automatically if it exists First to be loaded T File in NDDS_QOS_PROFILES The files or XML strings separated by semicolons referenced in this environment vari able are loaded automatically Ll working directory gt USER_QOS_PROFILES xml This file is loaded automati
174. on da doe tas lt dds gt This transformation plugin is implemented in the shared library lt Routing Service installation directory gt bin lt architecture gt librtirsassigntransf so or rtirsassigntransf dll for Windows sys tems Important The assign transformation only supports the assignment of primitive fields including strings that are not part of arrays or sequences For example transformation plugin name TransformationLib Assignment gt lt property gt lt value gt lt element gt lt name gt position x lt name gt lt value gt position y lt value gt lt element gt lt element gt lt not supported gt lt name gt x 0 lt name gt lt value gt y 0 lt value gt lt element gt lt element gt lt supported gt lt name gt position lt name gt lt value gt position lt value gt lt element gt lt value gt lt property gt lt transformation gt Creating New Transformations Routing Service provides a transformation SDK in C to support the creation of custom transfor mation plugins The SDK contains two main components 1 API header file Routing Service installation directory gt include routingservice routingservice_transformation h The transformation plugin will include this header I Infrastructure library Routing Service installation directory gt lib lt architecture gt librtirsinfrastructure so for UNIX based systems and lt Routing Service ins
175. on Tags Tags within ai Number of transformation Description Tags Allowed lt input_type_name gt Type name of the data samples this transformation receives Oor1 output type name Type name of the data samples this transformation creates Oor1 Sequence of name value string pairs that can be used to config ure certain parameters of the transformation For example property value element 0or1 lt name gt scaling factor lt name gt lt value gt 2 lt value gt lt element gt lt value gt lt property gt lt property gt For example lt dds gt lt routing service gt lt domain_route gt lt participant_1 gt lt domain_id gt 54 lt domain_id gt lt participant_1 gt connection 2 plugin name my adapter library jms gt connection 2 2 session auto route name AutoRoutel gt dds input participant 1 gt allow topic name filter gt lt allow topic name filter allow registered type name filter ShapeType allow registered type name filter dds input output allow stream name filter gt A allow stream name filter gt allow registered type name filter B allow registered type name filter lt output gt lt auto_route gt lt session gt lt domain_route gt lt routing_service gt lt dds gt 2 31 2 4 XML Tags for Configuring Routing Service The above auto route will lead to the creation of a route every ti
176. onfiguration file showcases the features mentioned in the previous section lt xml version 1 0 gt lt dds xmlns xsi http www w3 0rg 2001 XMLSchema instance xsi noNamespaceSchemaLocation resource schema rti routing service xsd gt types 1 Connext installation directory ndds version doc pdf RII CoreLibrariesAndUtilities GettingStarted ExtensibleTypesAddendum pdf 2 38 2 7 Support for Extensible Types lt Base type gt lt struct name MyBaseType extensibility extensible gt lt member name x type long gt lt member name y type long gt lt struct gt lt Extended type structure inheritance gt lt struct name MyDerivedType baseType MyBaseType extensibility extensible gt lt member name z type long gt lt struct gt lt types gt lt routing service name ExtensibleTypesTest gt domain route name test_dr gt participant 1 domain id 0 domain id lt Use of type signature gt registered type name MyDerivedType type name MyDerivedType participant 1 participant 2 domain id 1 domain id lt Use of type signature gt registered type name MyDerivedType type name MyDerivedType gt participant 2 session name test s enabled true gt topic route name derived tr input participant 1 gt topic name MyTopic topic name lt Refer to the registered ty
177. onnection with an adapter plugin defined within lt adapter_library gt see Section 2 1 2 8 2 4 XML Tags for Configuring Routing Service For DDS domains the connections are specified using the tags participant 1 and participant 2 Each tag has one domain route associated DomainParticipant entity monitoring The following example routes information between two e e ee es DDS domains participant 1 lt dds gt TEST domain id routing service name Routerl group_name Group1 gt domain route name DomainRoutel gt lt participant_1 gt lt domain_id gt 54 lt domain_id gt lt participant_1 gt lt participant_2 gt lt domain_id gt 55 lt domain_id gt lt participant_2 gt lt participant_2 gt ae lt session name Session gt lt session gt lt domain_route gt lt routing_service gt lt dds gt Configurations mixing connections and participants are allowed to provide communication between DDS domains PA and other data domains The following example routes information between a JMS provider network and a DDS domain lt dds gt lt routing service name Routerl group_name Group1 gt domain route name DomainRoutel gt connection 1 plugin name adapter library jms connection 1 participant 2 domain id 55 domain id participant 2 session name Session gt lt session gt lt domain_route gt routing
178. ot relevant in this example but they are still needed when using the regular Connext API import RTI RoutingService Administration CommandKind import RTI RoutingService Administration CommandRequest import RTI RoutingService Administration CommandRequestTypeSupport import RTI RoutingService Administration CommandResponse 1 The Request Reply Communication Pattern is only available with RTI Connext Messaging For information see the Core Libraries and Utilities User s Manual or API Reference HTML documentation 5 9 5 3 Accessing Routing Service from a Connext Application import RTI RoutingService Administration CommandResponseTypeSupport import com rti connext infrastructure Sample import com rti connext infrastructure WriteSample import com rti connext requestreply Requester import com rti connext requestreply RequesterParams import com rti dds domain DomainParticipant import com rti dds domain DomainParticipantFactory import com rti dds infrastructure Duration t import com rti dds infrastructure InstanceHandleSeq import com rti dds infrastructure StatusKind import com rti dds publication DataWriterQos How to use the Routing Service administration through a Requester public class CommandExample Static final String COMMAND TOPIC rti routing service administration command request Static final String RESPONSE TOPIC rti routing service administration command response private stat
179. otherwise stated 1 Comments are enclosed as follows comment gt The root tag of the configuration file must be dds and end with lt dds gt 2 3 2 3 XML Syntax and Validation Routing Service provides DTD and XSD files that describe the format of the XML content We rec ommend including a reference to one of these documents in the XML file that contains the rou tine service s configuration this provides helpful features in code editors such as Visual Studio and Eclipse including validation and auto completion while you are editing the XML file The DTD and XSD definitions of the XML elements are in lt Routing Service installation direc tory gt resource schema rti_routing_service dtd and Routing Service installation directory gt resource schema rti_routing_service xsd respectively To include a reference to the XSD document in your XML file use the attribute xsi xnoNamespaceSchemaLocation in the lt dds gt tag For example lt xml version 1 0 encoding UTF 8 gt dds xmlns xsi http www w3 0rg 2001 XMLSchema instance xsi noNamespaceSchemaLocation installation directory for RTI Routing Service resource schema rti routing _service xsd gt lt dds gt To include a reference to the DTD document in your XML file use the lt DOCTYPE gt tag For example lt xml version 1 0 encoding UTF 8 gt lt DOCTYPE dds SYSTEM lt installation directory for RTI Routing Service gt
180. output auto route dds output or auto route output 6 13 6 3 Monitoring Status Table 6 5 AutoRouteData Field Name Description output Indicates when the StreamWriter in created in the output creation_mode The output creation mode is configured using the tag lt creation_mode gt Contains the configuration of the auto_route s output that is specific to either the DDS adapter or a generic adapter output When a generic output is defined lt auto_route gt lt output gt the union discrim adapter_data inator is RII ROUTING SERVICE GENERIC ADAPTER KIND if it is a DDS output lt auto_topic_route gt lt output gt or lt auto_route gt lt dds_output gt the union discriminator is RTI ROUTING SERVICE DDS ADAPTER KIND output adapter data dds DDS output only Domain ID of the output participant domain id output adapter data generic property Not applicable for DDS output The properties used to configure this route s StreamWriter specified with the tag lt property gt inside route output paused Indicates if a route or auto route has been paused with the remote command pause 6 3 6 3 1 6 3 1 1 Monitoring Status Operational status for Routing Service entities is published in entity status set topics This infor mation changes continuously and is computed and published periodically The status information for the differe
181. pe name gt registered type name gt MyDerivedType registered type name gt datareader gos lt Define DataReader TypeConsistencyEnforcementQos gt type consistency kind ALLOW TYPE COERCION kind type consistency datareader qos input output topic name MyTopic topic name lt Refer to the registered type name gt registered type name gt MyDerivedType registered type name gt output topic route session domain route routing service dds 2 39 2 7 Support for Extensible Types 2 40 Chapter 3 Running Routing Service 3 1 3 2 Starting Routing Service Routing Service runs as a separate application The script to run the executable is located in lt Routing Service installation directory gt scripts Routing Service supports loading Java adapters If your configuration is set up to load a Java adapter follow these steps 1 On Windows Systems To use a Java adapter you must have the Visual Studio 2005 ser vice pack 1 redistributable libraries You can obtain this package from Microsoft or RTI see the RTI Core Libraries and Utilities Release Notes for details 2 Make sure Java 1 7 or higher is available 3 Make sure you add the directory of the Java Virtual Machine dynamic library to your environment variable LD_LIBRARY_PATH on UNIX based systems or Path on Win dows systems For example setenv LD L
182. ple loan void SimpleFileAdapterStreamReader return loan RTI RoutingServiceStreamReader stream reader RTI RoutingServiceSample sample list RTI RoutingServiceSampleInfo info list int count RTI RoutingServiceEnvironment env int verbosity verbosity RTI RoutingServiceEnvironment get verbosity env if verbosity RTI ROUTING SERVICE VERBOSITY DEBUG printf CALL SimpleFileAdapterStreamReader return loanin return Reads one line from the StreamReader file void SimpleFileAdapterStreamReader read RTI RoutingServiceStreamReader stream reader RTI RoutingServiceSample sample list RTI RoutingServiceSampleInfo info list int count RTI RoutingServiceEnvironment env DDS ReturnCode t retCode char line 2048 char str struct SimpleFileAdapterStreamReader self struct SimpleFileAdapterStreamReader stream reader int verbosity int length verbosity RTI RoutingServiceEnvironment get verbosity env if verbosity RTI ROUTING SERVICE VERBOSITY DEBUG 8 25 8 3 Creating New Adapters printf CALL SimpleFileAdapterStreamReader_read n count 0 sample list NULL We don t provide sample info in this adapter which is an optional feature info list NULL DDS DynamicData clear all members self gt sample 0 str fgets line sizeof line self gt fHandle if str return length strlen str if length gt
183. ption 0 error closing fileName public void read List lt Object gt sampleList List Object infoList throws AdapterException String line if verbosity equals debug System out println CALL getClass getName read try sampleList clear infoList clear dynamicData clear all members if fileReader ready line fileReader readLine dynamicData set_string value DynamicData MEMBER ID UNSPECIFIED line sampleList add dynamicData catch IOException e throw new AdapterException 0 error reading from file fileName e catch Exception e throw new AdapterException 0 error reading e public void returnLoan List Object sampleList List Object infoList throws AdapterException if verbosity equals debug System out println CALL getClass getName returnLoan af public void update Properties properties throws AdapterException parseProperties properties notificationThread setReadPeriod readPeriod Notification thread This thread will notify of data availability in the file f class NotificationThread extends Thread 8 48 8 3 Creating New Adapters 8 3 6 7 private BufferedReader fileReader null private int notificationPeriod private boolean _terminate private StreamReaderListener listener null private StreamReader str
184. r QoS policies 1 Within a domain route a topic cannot be associated with more than one type version This prevents the same domain route from having two topic routes with different ver sions of a type for the same Topic To achieve this behavior create two different domain routes each associating the topic with a different type version The type declared in a topic route input is the version that is passed to the output or to a trans formation The topic route can subscribe to different but compatible types but those samples are translated to the topic route s input type For example struct A long x e struct B long x long y s Samples forwarded by a Routing Service Samples published by topic route for type A Samples received two writers of types A and B respectively Input Output by a B reader A x 1 A x 1 A x 1 B x 1 y 0 B x 10 y 11 A x 10 A x 10 B x 10 y 0 Note that the second sample loses the extended field when it is forwarded by Routing Service A topic route using the extended type would avoid that truncation Samples forwarded by a Routing Service topic Samples published by route for type B Samples received two writers of types A and B respectively Input Output by a B reader Ape B x 1 y 0 B x 1 y 0 B x 1 y 0 B 10 y 11 B x 10 y 11 B x 10 y 11 B x 10 y 11 2 7 1 Example The following XML c
185. r s output bytes per s latency s Table 6 9 describes the fields in the RouteStatusSet data type Table 6 9 RouteStatusSet Member Name Description Key field routing service name ji E The routing service name assigned with appName Key field domain route name The domain route name Key field session name The session name Key field The route name name i E The route name is configured using the name attribute in the topic route or route tags 6 19 6 3 Monitoring Status Table 6 9 RouteStatusSet Member Name Description Statistic variable that provides information about the input samples per second in the route input samples per s Input samples refer to the samples that are taken by the session from the route s Stream Reader Statistic variable that provides information about the input bytes per second in the route Hout bytes pers Input bytes refer to the bytes that are taken by the session from the route s StreamReader dil ARM i These bytes only refer to the serialized samples The protocol headers UDP RTPS are not included Statistic variable that provides information about the output samples per second in the routes output samples per s Output samples refer to the samples that are published out by the session thread using the route s StreamWriters Statistic variable that provides informatio
186. re also notified using the discovery StreamReader For additional information see Stream Discovery Section 8 2 2 Implementation of this API is optional However if none of the adapters in a domain route implement the discovery API the routes types must be declared in the configura tion file copy_type_ representation Copies a type representation object RoutingServiceTypeRepresentation The format of the type representation is given by the representation kind For example if the representation kind is RTI_ROUTING_SERVICE_TYPE_REPRESENTATION_DYNAMIC_TYPE the type_representation will be a DDS TypeCode This method is part of the adapter discovery API and is used by Routing Service to copy the type representation of discovered streams see Stream Discovery Section 8 2 2 Implementation of this API is optional and tied to the implementation of get_input_stream_discovery_reader and get_output_stream_discovery_reader delete_type_ Deletes a previously created type representation object This method is part of the adapter discovery API representation Implementation of this API is optional and tied to the implementation of get_input_stream_discovery_reader and get_output_stream_discovery_reader Updates the connection s configuration update This method is called when the update command is received by the domain route con taining the connection see Section 5 2 12 Implementation of this API is op
187. rmat Either private_key or private_key_file may be specified Do not set both of them this would produce a configuration error If both are unspecified NULL the private key must be appended to the certificate chain file tls identity private_key_file A string that specifies the name of a file containing a private key in PEM format Either private_key or private_key_file may be specified Do not set both of them this would produce a configuration error If both are unspecified NULL the private key must be appended to the certificate chain file 1 Assuming you used dds transport TCPv4 tcp1 as the alias to load the plugin If not change the prefix to match the string used with dds transport load_plugins 2 See Connext installation directory ndds version doc pdf RTI CoreLibrariesAndUtilities UsersManual pdf 7 15 Chapter 8 Extending Routing Service with Adapters As described in Section 2 4 8 adapters are pluggable components that allow Routing Service to consume and produce data for different data domains e g Connext JMS Socket etc By default Routing Service is distributed with a built in DDS adapter Any other adapter plugins must be provided as shared libraries or Java classes and registered within the lt adapter_library gt tag The figure to the right describes the Routing Service adapter archi tecture Input adapters are used to collect data samples from different d
188. rmation per route is supported paused Indicates if a route or auto route has been paused with the remote command pause The correlation between a route using DDS and its DataReader and DataWriter can be done using the fields datareader_key and datawriter_key For example let s assume that we want to retrieve the value of the DurabilityQosPolicy associ ated with the route s DataWriter To do that we would subscribe to the publication builtin topic and we would look for a sample where the key member is equal to datawriter_key From this sample we can get the DurabilityQosPolicy value accessing the member durability For additional information on how to subscribe to the builtin topics see the RTI Core Libraries and Utilities User s Manual Route data samples are published when 1 The route is enabled 1 The route is disabled dispose sample 1 The route configuration is modified using the remote command update 1 The route s StreamReader is created 1 The route s StreamReader is destroyed 1 The route s StreamWriter is created 1 The route s StreamWriter is destroyed lL Monitoring is enabled via remote administration Configuration Data for an Auto Route The topic that publishes auto route configuration data is called rti routing service monitoring auto route data The IDL definition of the data type RTT RoutingService Monitoring AutoRouteData is struct AutoRouteAdapterData sequence lt Prope
189. rmation transformation RTI RoutingServiceEnvironment env The transformation parameter corresponds to the value returned by the function create transformation LJ transform This function is called in a route to transform a sequence of input data samples into a sequence of output data samples typedef void RTI RoutingServiceTransformation transform RTI RoutingServiceTransformation transformation TI RoutingServiceSample out sample lst TI RoutingServiceSampleInfo out info lst nsigned int out count TI RoutingServiceSample in sample lst TI RoutingServiceSampleInfo in info lst nsigned int in count RTI RoutingServiceEnvironment env C mcum When the routing service is done using the output samples it will return the loan to the transformation by calling the return loan operation The transformation parameter corresponds to the value returned by the function create transformation LJ return loan Indicates to the transformation that the routing service is done accessing the sequence of data samples obtained by an earlier invocation of transform typedef void RTI RoutingServiceTransformation return loan RTI RoutingServiceTransformation transformation RTI RoutingServiceSample sample lst RTI RoutingServiceSampleInfo info lst unsigned int count RTI RoutingServiceEnvironment env The transformation parameter corresponds to the value returned by the function create tran
190. rnal send function is called When it is set to 1 the transport will make a copy of the data to send and enqueue it in an internal send buffer Data will be sent as soon as the low level socket buffer has space Normally setting it to 1 delivers better throughput in a fast network but will result in a longer time to recover from various TCP error conditions Setting it to 0 may cause the low level send function to block until the data is physically delivered to the lower socket buffer For an application writing data at a very fast rate it may cause the caller thread to block if the send socket buffer is full This could produce lower throughput in those conditions the caller thread could prepare the next packet while waiting for the send socket buffer to become available Default 0 max packet size The maximum size of a TCP segment This parameter is only supported on Linux architectures By default the maximum size of a TCP segment is based on the network MTU for des tinations on a local network or on a default 576 for destinations on non local networks This behavior can be changed by setting this parameter to a value between 1 and 65535 Default 1 default behavior enable keep alive Configures the sending of KEEP ALIVE messages in TCP Setting this value to 1 causes a KEEP ALIVE packet to be sent to the remote peer if a long time passes with no other data sent or received This feature is implemented only on
191. rns a single sam ple stored in the StreamReader e Two calls to SimpleFileAdapterStreamReader_read cannot occur in parallel L SimpleFileAdapterStreamReader run Routing Service will not call the read operation until it is notified of the presence of new data see Section 8 2 3 To provide data notifica tion the StreamReader implementation creates a thread that wakes up after read_period and notifies Routing Service of new data if the end of the file has not been reached yet SimpleFileAdapterStreamReader_run is the function executed by the notification thread L SimpleFileAdapterConnection delete stream reader This function is called to destroy a StreamReader The implementation will finalize the notification thread and close the file handle L SimpleFileAdapterConnection create stream reader This function is called when a new StreamReader is created Among other things the implementation will open the file that will be read and create the notification thread 8 24 8 3 Creating New Adapters Insert the following code in the Simple File Adapter StreamReader section of SimpleFil eAdapter c StreamReader struct SimpleFileAdapterStreamReader int run ifdef RTI WIN32 HANDLE thread else pthread t thread endif Y DDS DynamicData sample 1 j struct DDS Duration t readPeriod Struct RTI RoutingServiceStreamReaderListener listener FILE fHandle Returns sam
192. roperty Name prefix with dds transport TCPv4 tcp1 Description parent gather send buffer count max Specifies the maximum number of buffers that Connext can pass to the send function of the transport plugin The transport plugin send operation supports a gather send concept where the send call can take several discontiguous buffers assemble and send them in a single message This enables Connext to send a message from parts obtained from different sources without first having to copy the parts into a single contiguous buffer However most transports that support a gather send concept have an upper limit on the number of buffers that can be gathered and sent Setting this value will prevent Connext from trying to gather too many buffers into a send call for the transport plugin Connext requires all transport plugin implementations to support a gather send of least a minimum number of buffers This minimum number is defined as NDDS TRANSPORT PROPERTY GATHER SEND BUFFER COUNT MIN Default 128 parent message size max The maximum size of a message in bytes that can be sent or received by the transport plugin If you set this higher than the default the DomainParticipant s buffer size in the RECEIVER POOL QosPolicy see the RTI Core Libraries and Utilities User s Manual should also be changed Default 9216 parent allow_interfaces_list A list of strings each identifying a range
193. roup name Group1 gt routing service dds Starting Routing Service with the following command will use the routing service tag with the name Router rtiroutingservice cfgFile example xml cfgName Routerl Because a configuration file may contain multiple routing service tags one file can be used to configure multiple Routing Service executions A routing service may belong to a group of several routing services identified by a com mon group name This common name can lt routing_service gt be used to implement a specific policy when the communication happens between rout erii nins ing services of the same group For example Section 2 4 3 in the builtin DDS adapter a participant will ignore other participants in the same group L lt monitoring gt as a way to avoid circular communication Optional SOLON AAA If the lt routing_service gt tag does not have a group_name attribute Routing Service will lt entity_monitoring gt Section 2 4 4 use the following name RTI_RoutingService_ lt Host Name gt _ lt Pro cess ID gt such as amaia ene RTI_RoutingService_myhost_20024 Required Section 2 4 2 Table 2 2 describes the tags allowed within a lt routing_service gt tag Notice that the lt domain_route gt tag is required 2 4 XML Tags for Configuring Routing Service Table 2 2 Routing Service Tags Tags within lt routing_service gt Description Number
194. routingservice_infrastructure h This header file defines the public interface of the infrastructure library SDK header files Header Location lt Routing Service home gt include routingservice routingservice_infrastructure h lt Routing Service home gt include routingservice routingservice_adapter h C Adapter API This section does not intend to give complete information on all the C API functions but rather to describe the aspects of the API that are specific to the C language For detailed information about the C API please see the online HTML Routing Service docu mentation Every adapter plugin will implement a plugin constructor entry point to the shared library that will be used by Routing Service to create a plugin instance typedef struct RTI_RoutingServiceAdapterPlugin RTI_RoutingServiceAdapterPlugin CreateFcn const struct RTI RoutingServiceProperties properties RTI RoutingServiceEnvironment env The entry point function is specified in the configuration file using the tag create function within adapter plugin see Section 8 1 The structure RTI RoutingServiceAdapterPlugin will contain the plugin implementation as a set of function pointers This structure also encapsulates the plugin version information that will be used by Routing Service for logging purposes struct RTI RoutingServiceAdapterPlugin int init struct RTI RoutingServiceVersion rs version The version of the a
195. rrent configuration to a file The file itself is specified with save path see page 2 14 If save path has not been specified the save command will fail If the file specified by save path already exists the file will be overwritten The saved configuration is functionally equivalent to the loaded XML file plus any updates either from an update command or other remote commands that change the configuration such as add peer However it may not be textually equivalent For example the saved XML configuration may explicitly contain default values that were not in the initial XML 5 5 5 2 Remote Commands 2 11 2 12 Table 5 1 Entity Note If the lt autosave_on_update gt tag see Table 2 6 Remote Administration Tags on page 2 13 is set to TRUE this will automatically trigger a save command when configuration updates are received unload unload target routing service The unload command unloads the current configuration that the target routing service is using so you can change it with a subsequent load Section 5 2 7 command The target routing service must be disabled for this command to succeed update update target routing service entity name lt xml_url gt lt assignment_expr gt remote local The update command changes the configuration of a specific entity Table 5 1 shows the param eters that can be changed for each entity Changeable Parameters Mutable Immu
196. rs 8 3 3 5 tag lt property gt within lt adapter_plugin gt see Adapter Usage and Configuration Section 8 1 The environment parameter env is part of every function in the adapter API This parameter is used to get information about the Routing Service execution such as the version or the verbosity In addition the environment is also used to notify Routing Service of any error in the adapter execution Implementing the Adapter Connection The adapter plugin instances are connection factories Connection objects provide access to data domains such as DDS domains or JMS network providers and they are configured using the XML tags lt connection_1 gt and lt connection_2 gt in a lt domain_route gt see Section 2 4 2 In the SimpleFileAdapter example the connection objects will provide access to a directory on your computer s file system The next step consist on implementing the functions that create and delete a connection Insert the following code in the Simple File Adapter Connection section of SimpleFileA dapter c Connection struct SimpleFileAdapterConnection char directory Y Deletes a connection void SimpleFileAdapter delete connection struct RTI_RoutingServiceAdapterPlugin adapter RTI_RoutingServiceConnection connection RTI_RoutingServiceEnvironment env struct SimpleFileAdapterConnection cx struct SimpleFileAdapterConnection connection int verbosity ver
197. rs the filter information coming from all of its matching DataReaders and provides the resulting com posed filter to the route s input StreamReader whose DataReader is responsible to send this information to all of its matching DataWriters Filter Propagation Events There are several events that will cause a StreamReader s filter to be updated and propagated LI Route s StreamReader creation The initial filter is set to the stop band filter which is a spe cial kind of filter that does not let any sample pass This filter is propagated upon Stream Reader s DataReader creation and it will remain unchanged until a matching DataReader to the route s StreamWriter is discovered 9 3 9 2 Filter Propagation Behavior 9 2 2 Table 9 1 9 2 3 1 Discovery of a matching DataReader in a route The filter of the discovered DataReader will be aggregated to the existing StreamReader s filter which will be propagated after being updated If the discovered DataReader does not have a filter subscribes to all the samples or it has a non SQL filter the StreamReader s filter is set to the all pass filter which is a special kind of filter that let all sample pass The all pass filter will remain set until there are no matching DataReaders to the route s StreamWriter without filter or with a non SQL filter LJ A matching DataReader changes its filter either in the expression or in the parameters The StreamReader s filter is updat
198. rty MAX PROPERTIES property struct AutoRouteDdsInputData long domain id String EXPRESSION MAX LENGTH content filter expression union AutoRouteInputAdapterData switch AdapterKind case RTI ROUTING SERVICE DDS ADAPTER KIND AutoRouteDdsInputData dds 1 See Connext installation directory ndds version doc pdf RTI_CoreLibrariesAndUtilities_UsersManual pdf 6 10 6 2 Monitoring Configuration Data case RTI ROUTING SERVICE GENERIC ADAPTER KIND AutoRouteAdapterData generic struct AutoRouteDdsOutputData long domain_id union AutoRouteOutputAdapterData switch AdapterKind case RTI ROUTING SERVICE DDS ADAPTER KIND AutoRouteDdsOutputData dds case RTI ROUTING SERVICE GENERIC ADAPTER KIND AutoRouteAdapterData generic struct AutoRoutelnputData string TOPIC NAME MAX LENGTH allow stream name filter string TYPE NAME MAX LENGTH allow registered type name filter string TOPIC NAME MAX LENGTH deny stream name filter string TYPE NAME MAX LENGTH deny registered type name filter long connection RouteCreationMode creation mode AutoRouteInputAdapterData adapter data struct AutoRouteOutputData string lt TOPIC_NAME MAX LENGTH allow stream name filter string TYPE NAME MAX LENGTH allow registered type name filter string lt TOPIC_ NAME MAX LENGTH deny stream name filter string TYPE NAME MAX LENGTH deny registered type name filter RouteCreationMode cre
199. s not reported as UP will not be used This property allows the same check to be extended to the IFF RUNNING flag imple mented by some operating systems The RUNNING flag means that all resources are allocated and may be off if no link is detected e g the network cable is unplugged Two values are allowed 0 Do not check the RUNNING flag when enumerating interfaces just make sure the interface is UP 1 Check the flag when enumerating interfaces and ignore those that are not reported as RUNNING This can be used on some operating systems to cause the transport to ignore interfaces that are enabled but not connected to the network Default 1 transport priority mask Mask for the transport priority field This is used in conjunction with transport priority mapping low transport priority mapping high to define the mapping from Connext transport priority to the IPv4 TOS field Defines a contiguous region of bits in the 32 bit transport priority value that is used to generate values for the IPv4 TOS field on an outgoing socket For example the value 0x0000ff00 causes bits 9 16 8 bits to be used in the mapping The value will be scaled from the mask range 0x0000 Oxff00 in this case to the range specified by low and high If the mask is set to zero then the transport will not set IPv4 TOS for send sockets Default 0 7 9 7 2 Configuring the TCP Transport Table 7 1 TCP TLS Transport Properties over LAN or WAN
200. s required free cx return NULL cx directory char malloc strlen directory 41 if cx gt directory NULL RTI_RoutingServiceEnvironment_set_error env Memory allocation error free cx return NULL strcpy cx gt directory directory return cx From the implementation you can see that the connection object encapsulates the name of the directory from which the StreamReaders and StreamWriters will read and write files The value of the RTI RoutingServiceAdapterPlugin structure created in SimpleFileAdapter_create must be updated to contain the two new functions adapter gt adapter plugin create connection SimpleFileAdapter create connection adapter gt adapter plugin delete connection SimpleFileAdapter delete connection Implementing the StreamReader The connection objects are factories of StreamReaders A StreamReader provides a way to read data samples of a specific type from a data domain In the configuration file StreamReaders are associated with the tag lt input gt within lt route gt or lt auto_route gt see Section 2 4 6 The StreamReaders created by the SimpleFileAdapter connections read text files from the con nection directory 8 23 8 3 Creating New Adapters The data samples provided to Routing Service using the read operation are DynamicData with the following IDL type struct TextLine string lt 1024 gt value When a SimpleFileAdapter
201. sec gt lt status_publication_ lt nanosec gt 0 lt nanosec gt period gt lt status publication period gt 0or1 If the tag is not defined the period is 5 seconds The status publication period defined in lt routing_service gt is inher ited by all the entities inside lt routing_service gt An entity can overwrite the period Monitoring Configuration Inheritance The monitoring configuration defined in lt routing_service gt is inherited by all the entities defined inside the tag An entity can overwrite three elements of the monitoring configuration 1 The status publication period 1 The statistics sampling period 1 The historical statistics windows Each one of this three elements is inherited and can be overwritten independently using the lt entity_monitoring gt tag For example lt dds gt routing service name MonitoringExample gt monitoring domain id 55 domain id status publication period lt sec gt 1 lt sec gt lt status publication period statistics sampling period lt sec gt 1 lt sec gt lt nanosec gt 0 lt nanosec gt lt statistics sampling period gt lt monitoring gt 2 17 2 4 XML Tags for Configuring Routing Service lt domain_route gt lt entity monitoring gt lt status publication period gt lt sec gt 4 lt sec gt lt status publication period gt lt entity monitoring gt lt domain_route gt routing service dds
202. sformation 1 update This function is called when the configuration of a transformation changes as a result of a remote update command typedef void RTI RoutingServiceTransformation UpdateFcn RTI RoutingServiceTransformation transformation const struct RTI RoutingServiceProperties properties RTI RoutingServiceEnvironment env 4 6 Chapter 5 Administering Routing Service from a 5 1 Remote Location Routing Service can be controlled remotely by sending commands through a special topic Any Connext application can be implemented to send these commands and receive the correspond ing responses A shell application that sends receives these commands is provided with Routing Service The script for the shell application is in Routing Service installation directory gt scripts rtirssh Entering rtirssh help will show you the command line options RTI Routing Service Shell Usage rtirssh options Options domainId lt integer gt Domain id for the remote configuration timeout lt seconds gt Max time to wait a remote response cmdFile lt file gt Run commands in this file help Displays this information Enabling Remote Administration By default remote administration is disabled in Routing Service for security reasons To enable remote administration you can use the lt administration gt tag see Section 2 4 3 or the remoteAdministrationDomainId ID command line parameter which enables remote admin
203. sport Firewall NAT Firewall NAT Router lt 7 AQ Router TCP traffic only Initial Peers represents the peers to which the participant will be announced to Usually these peers are configured using the DiscoveryQosPolicy of the participant or the environment variable NDDS_DISCOVERY_PEERS For information on the format of initial peers see Section 7 2 1 Figure 7 2 Communication within a Single LAN cc o OS parent classid n 0v parent classid Participant NDDS TRANSPORT f Participant NDDS TRANSPORT ES pon CLASSID TCPV4 LAN TCPv4 Transport CLASSID_TCPV4_LAN IP address server bind port 7400 IP address server bind port 7400 192 168 1 11 192 168 1 12 mode Initial Peers Initial Peers 192 168 1 12 7400 192 168 1 11 7400 AN A 7 1 2 Symmetric Communication Across NATs In NAT communication scenarios each one of the LANs has a private IP address space The communication with other LANs is done through NAT routers that translate private IP addresses and ports into public IP addresses and ports In symmetric communication scenarios any instance of Routing Service can initiate TCP connec tions with other routing services Figure 7 3 shows how to configure the TCP transport in this scenario Notice that initial peers refer to the public address of the Routing Service instances and not the LAN address In addition the transport associated with a Routing Service instance will have to be co
204. ss SimpleFileAdapterStreamWriter implements StreamWriter private String verbosity null private String fileName null private boolean printToStdout private BufferedWriter fileWriter null 1 c adapters SimpleFileAdapter for Windows systems or opt adapters simplefile for UNIX based systems 8 50 8 3 Creating New Adapters y private void parseProperties Properties properties int printToStdoutInt String printToStdoutStr printToStdoutStr properties getProperty print to stdout if printToStdoutStr null printToStdout false else printToStdoutInt new Integer printToStdoutStr intValue if printToStdoutInt 0 printToStdout true else printToStdout false xy SimpleFileAdapterStreamWriter StreamInfo streamInfo Properties properties String directory String verbosity throws AdapterException this verbosity verbosity parseProperties properties fileName streamInfo getStreamName txt try fileWriter new BufferedWriter new FileWriter new File directory fileName catch IOException e throw new AdapterException 0 error opening fileName i void close throws AdapterException try if fileWriter null fileWriter close catch IOException e throw new AdapterException 0 error closing fileName public int write List lt Object gt sampleList List lt Objec
205. st parameter of each adapter API is the environment RTI_RoutingServiceEnvironment This parameter is used to get information about the Routing Service execution such as the version or the verbosity The environment is also used by the adapter implementations to provide error notification Adapter Verbosity The C adapter implementations can access the verbosity level used to run Routing Service by using the following environment function RTI_RoutingServiceVerbosity RTI_RoutingServiceEnvironment get verbosity const RTI RoutingServiceEnvironment self The mapping between the command line option verbosity and the RTI_RoutingServiceVerbosity enumeration is as follows Mapping between verbosity and RTI_RoutingServiceVerbosity verbosity RTI_RoutingServiceVerbosity 0 RTI_ROUTING_SERVICE_VERBOSITY_NONE 1 RTI_ROUTING_SERVICE_VERBOSITY_EXCEPTION 2 RTI_ROUTING_SERVICE_VERBOSITY_WARN 3and 4 RTI_ROUTING_SERVICE_VERBOSITY_INFO 5and 6 RTI_ROUTING_SERVICE_VERBOSITY_DEBUG Version Information Routing Service and the different adapter implementations are identified by a version number The adapter version is provided to Routing Service using the member plugin_version in the RTI_RoutingServiceAdapterPlugin structure This member must be initialized in the adapter entry point function it is used by Routing Service for logging purposes The Routing Service version is provided to the C adapters through the environme
206. stems It scales RTI Connext applications across domains LANs and WANs including firewall and NAT traversal Routing Service also supports DDS to DDS bridg ing by allowing you to make transformations in the data along the way This allows unmodified DDS applications to communicate even if they were developed using incompatible interface definitions This is often the case when integrating new and legacy applications or indepen dently developed systems Using RTI Routing Service Adapter SDK you can extend Routing Ser vice to interface with non DDS systems using off the shelf or custom developed adapters including to third party JMS implementations and legacy code written to the network socket API Traditionally Connext applications can only communicate with applications in the same domain With Routing Service you can send and receive data across domains You can even transform and filter the data along the way Not only can you change the actual data values you can change the data s type So the sending and receiving applications don t even need to use the same data structure You can also control which data is sent by using allow and deny lists Connext Application vt T Connext Application Service Service et JMS Application Simply set up Routing Service to pass data from one domain to another and specify any desired data filtering and transformations No changes are required in the Connext applications Key benefits of Routi
207. t include lt string h gt Ejfifdef RTI_WIN32 L include lt process h gt E else L include lt pthread h gt Hendif 481 dx 19495 p vao x include ndds ndds_c h include routingservice routingservice_adapter h G ifdef RTI_WIN32 Disbale strtok fopen warnings pragma warning disable 4996 define DllExport declspec dllexport B else L fdefine DllExport lol Hendif d lSoluti Show output from Build 48 9 ex Cl E ly En zd Code Definition Window Call Browser Output E Find Results 1 Ready 6 Right click on SimpleFileAdapter Properties e n the Configuration combo box select All Configurations e Select Configuration Properties C C General SimpleFileAdapter Property Pages 21 x1 Configuration Jan Configurations y Platform active win32 y Configuration Manager Common Properties Additional Include Directo Configuration Properties Resolve using References General Debug Information Format Debugging Suppress Startup Banner Yes fnologo C C Warning Level Level 3 W3 General Detect 64 bit Portability Issues No Optimization Treat Warnings As Errors No Preprocessor Use UNICODE Response Files Yes Code Generation Language Precompiled Headers Output Files Browse Inform
208. t topic name Circle c topic name registered type name ShapeType registered type name gt output topic route lt session gt lt domain_route gt routing service gt lt dds gt In the previous example the direction of the mapping is defined by the attribute participant of the tag lt input gt Therefore to change the above example to read Squares from domain 55 and write Circles on domain 54 we would use lt input participant 2 There is an equivalent attri bute for non DDS inputs called connection Inputs and outputs in a route or topic route have an associated StreamReader and StreamWriter respectively For domains the StreamReader will contain a DataReader and the StreamWriter will contain a DataWriter The DataReaders and DataWriters belong to the corresponding ses sion s Subscriber and Publisher The read and write operations in a route will be performed in the context of the thread associ ated with the session Routes vs Auto Routes A route is an explicit route of data for two specific streams An auto route defined with a different tag lt auto_route gt is a way to automatically create routes based on fil ters see Auto Routes Section 2 4 7 Table 2 10 lists the tags allowed within a lt route gt Table 2 11 lists the tags allowed within a lt topic_route gt Table 2 12 lists the tags allowed within the input and output tags in a lt route gt tag Table 2 13 lists the tags allowe
209. t creation_mode gt lt input gt lt output gt lt creation_mode gt ON DOMAIN AND ROUTE MATCH lt creation_mode gt lt output gt lt topic_route gt Example 3 In this example all the data is received by the topic route s DataReader because it is created as soon as a user DataWriter is discovered on the first domain However the data is not resent until a user DataReader on the other domain subscribes to it lt topic_route gt lt input participant 1 gt creation mode gt ON_ DOMAIN MATCH lt creation mode gt lt input gt lt output gt lt creation_mode gt ON_DOMAIN AND ROUTE MATCH lt creation_mode gt lt output gt lt topic_route gt Data Transformation A route can transform the incoming data using a transformation an object created by a transfor mation plugin 2 29 2 4 XML Tags for Configuring Routing Service For example the following transformation switches the coordinates of the input sample x becomes y and y becomes x topic route name SquareSwitchCoord gt lt input participant 1 gt topic name Square topic name registered type name gt ShapeType lt registered type name gt input output topic name Square topic name registered type name gt ShapeType lt registered type name gt output transformation plugin name transformationLib assign gt lt property gt lt value gt lt element gt lt name gt X lt name gt lt value g
210. t in lt topic_route gt propagate_unregister publish_with_original_info publish_with_original_ timestamp DDS topic routes only Indicates if the topic route propagates NOT_ALIVE_NO_WRITERS samples The propagation of NOT_ALIVE_NO_WRITERS samples is configured using the tag lt propagate_unregister gt in lt topic_route gt DDS topic routes only Indicates if the topic route publishes the samples with original writer info Setting this option to true allows redundant topic routes and prevents the applications from receiving duplicate samples The publication with original writer info is configured using the tag lt publish_with_original_info gt inside lt topic_route gt Indicates if the route is configured to publish the output samples with the same timestamp as that of the input sample route_types Indicates if the input connection will use types discovered in the output con nection and viceversa for the creation of StreamWriters and StreamReaders The route types flag is configured using the tag lt route_types gt inside lt route gt or lt topic_route gt The configuration of the route s input as contained in the tag lt input gt or adapter_data input PUE P dds input inside route or topic route Input stream name input The input stream name is configured using the tag topic name inside stream name topic route input or inside route dds input or the
211. t Y lt value gt lt element gt lt element gt lt name gt Y lt name gt lt value gt X lt value gt lt element gt lt value gt lt property gt lt transformation gt lt topic_route gt To include a transformation in a route 1 Implement the transformation plugin API and generate a shared library See Chapter 4 Transforming Data with Routing Service for more information 2 Register that library in the configuration file by creating a lt transformation_plugin gt tag inside a lt transformation_library gt tag As noted in Table 2 1 lt transformation_library gt is a top level tag 3 Instantiate a transformation by creating a lt transformation gt tag inside a lt route gt or a lt topic_route gt tag Table 2 15 lists the tags allowed within a lt transformation gt tag For additional information about transformations see Chapter 4 Transforming Data with Rout ing Service 2 4 7 Auto Routes The tag lt auto_route gt defines a set of potential routes with the same input and output type and same input and output stream name A route can eventually be instantiated when a new stream is discovered with a type name and a stream name that match the filters in the auto route When this happens a route is created but not necessarily started see Section 2 4 6 4 with the configuration defined in the auto route tag 2 30 2 4 XML Tags for Configuring Routing Service Table 2 15 Transformati
212. t gt infoList throws AdapterException String line ListIterator iterator sampleList listIterator DynamicData dynamicData null 8 51 8 3 Creating New Adapters if verbosity equals debug System out println CALL getClass getName write try while iterator hasNext dynamicData DynamicData iterator next line dynamicData get_string value DynamicData MEMBER ID UNSPECIFIED fileWriter write line fileWriter newLine if printToStdout System out println line catch IOException e throw new AdapterException 0 error writing to file fileName e catch Exception e throw new AdapterException 0 error writing e return 0 af public void update Properties properties throws AdapterException parseProperties properties 8 3 6 8 Running the SimpleFileAdapter This section describes the steps required to use and run the SimpleFileAdapter with Routing Ser vice You will create a configuration file with a single route that reads a HelloWorld text file from an input directory and saves it into an output directory 1 Compile and build the SimpleFileAdapter UNIX based systems gt cd opt adapters simplefile gt build sh Windows systems gt cd c adapters SimpleFileAdapter gt build cmd 2 In the adapter project directory c adapters SimpleFileAdapter on Windows systems opt adapters simplef
213. t xml_url gt to modify single values in an entity configuration The assignment expression has the form lt fully qualified value name gt lt value gt For example update ShapeRouter DomainRoutel Sessionl SquareToCircles topic route input datareader qos deadline period sec 3 update ShapeRouter DomainRoutel Sessionl SquareToCircles topic route input content filter expression x 30 1 domain route name is the fully qualified name of a domain route entity entity name is a fully qualified name For example consider the following XML config uration routing service name ShapeRoutingService gt domain route name DomainRoutel gt session name Session gt topic route name SquaresToCircles gt The above XML configuration would allow you to use commands such as enable ShapeRoutingService DomainRoutel Session SquaresToCircles enable ShapeRoutingService DomainRoutel Note that the fully qualified name does not include the name of the routing service 5 2 5 2 Remote Commands 5 2 1 5 2 2 2 peer list is a comma separate list of peers Lj lt target_routing_service gt can be e The application name of a routing service such as MyRoutingServicel as spec ified at start up with the command line option appName e A regular expression for a routing service name such as MyRoutingService xml url can be e A file URL such as file home user my
214. table changeable any time only changeable when entity is disabled Routing lt entity_monitoring gt lt enabled gt Service lt entity_monitoring gt lt status_publication_period gt wor monitoring statistics sampling period monitoring enabled itoring gt PUE 5E bigs monitoring historical statistics monitoring status publication period 8 gt monitoring domain id entity monitoring statistics sampling period NE entity monitoring historical statistics administration save path y 8 gt gt administration administration autosa n update administration lt antos ve on update lt all except save_path and autosave_on_update gt lt connection_x gt Mutable properties in lt connection_x gt Immutable properties in lt property gt adapter specific lt property gt adapter specific Domain lt participant_x gt Mutable QoS policies in participant qos Immutable QoS policies in route lt participant_qos gt lt participant_qos gt entity monitoring enabled entity monitoring statistics sampling period entity monitoring status publication period entity monitoring historical statistics For non DDS adapter Mutable properties in For non DDS adapter Mutable properties in prop property adapter specific erty gt adapter specific For DDS adapter Mutab
215. tallation directory gt lib lt architecture gt rtirsinfrastructure dll for Windows systems The transformation plugin will link with this library 4 4 4 3 Creating New Transformations 4 3 1 Transformation plugins working with TypeCode and DynamicData must also link with the Con next libraries Important Because RTI only distributes the release version of Routing Service your transforma tion should be linked against the release version of the Connext shared libraries when needed Transformation Plugin API Every transformation plugin will implement a plugin constructor entry point to the shared library that will be used by Routing Service to create a plugin instance typedef struct RTI_RoutingServiceTransformationPlugin RTI_RoutingServiceTransformationPlugin create RTI_RoutingServiceEnvironment env The structure RTI_RoutingServiceTransformationPlugin will contain the plugin implementation as a set of function pointers struct RTI_RoutingServiceTransformationPlugin RTI RoutingServiceTransformationPlugin DeleteFcn transformation plugin delete RTI RoutingServiceTransformationPlugin CreateTransformationFcn transformation plugin create transformation RTI RoutingServiceTransformationPlugin DeleteTransformationFcn transformation plugin delete transformation RTI RoutingServiceTransformation TransformFcn transformation transform RTI RoutingServiceTransformation ReturnLoanFcn transformation return loan RTI
216. te entity monitoring See Monitoring Section 2 4 4 and Chapter 6 Monitoring Routing 0 or 1 Service from a Remote Location The topic routes are created with this configuration Indicates whether or not filter propagation is enabled When set to true the StreamReader s filter will be automatically set filter propagation as the union of all the filters of the DataReaders matching the 0 or 1 route s StreamWriter For more information see Chapter 9 Propa gating Content Filters Default false lt input gt a the auto topic route s input topic See Auto Routes Section quad lt output gt Defines the auto topic route s output topic See Auto Routes Sec duns tion 2 4 7 Indicates whether or not the topic routes created by this auto topic lt propagate_dispose gt route must propagate disposed samples NOT_ALIVE_DISPOSE 0 or 1 Default true Indicates whether or not the topic routes created by this auto topic lt propagate_unregister gt route must propagate disposed samples NOT ALIVE DISPOSE 0 or 1 Default true The topic routes are created with this configuration When this flag is set to true if you have N topic routes for the same publish with topic in different routers or in the same one each sample that was 0orl original info written from a DataWriter in the input domain will be routed N times but DataReaders on the output domain will only see one Default false The topic routes are created with this co
217. te samples of a specific type into a data domain In the configuration file StreamWriters are associated with the tag lt output gt within lt route gt or lt auto_route gt see Section 2 4 6 The SimpleFileAdapter StreamWriters create new files into the connection directory and store the lines read from the routes inputs The data samples provided to the write operation of the StreamWriters are DynamicData with the following IDL type struct TextLine string lt 1024 gt value y When a SimpleFileAdapter StreamWriter is created the name of the file is the output stream name with txt extension For debugging purposes the StreamWriter can be configured to print the written samples on the console route name route gt lt output gt lt stream_name gt HelloWorld lt stream_name gt registered type name TextLine registered type name gt property value element lt name gt print_to_stdout lt name gt lt value gt 1 lt value gt lt element gt lt value gt lt property gt lt output gt lt route gt In the previous example the output StreamWriter will store the lines provided by Routing Ser vice on a file called HelloWorld txt It will also print the lines on the screen Insert the following code in the Simple File Adapter StreamWriter section of SimpleFil eAdapter c StreamWriter struct SimpleFileAdapterStreamWriter int printToStdout FILE fHandle
218. te name route gt lt input connection 1 gt lt stream_name gt HelloWorld lt stream_name gt registered type name gt TextLine lt registered_type name gt lt property gt lt value gt lt element gt lt name gt read_period lt name gt lt value gt 1000 lt value gt lt element gt lt value gt lt property gt lt input gt lt route gt 8 45 8 3 Creating New Adapters In the previous example the input StreamReader will read the lines of a a file called Hello World txt and it will provide one line per second to Routing Service The next step consist on the implementation of the StreamReader class There are three main methods d Create read This method will be called by Routing Service after being notified that the are new lines available Although the signature of the method allows returning more than one sample line for the sake of simplicity the implementation only returns one line every time the method is called Routing Service will not call the read operation until it is notified of the presence of new data see Section 8 2 3 To provide data notification the StreamReader implementation creates a thread NotificationThread that wakes up after read_period and notifies Rout ing Service of new data if the end of the file has not been reached yet return_loan The loan on the samples provided by read is returned to the StreamReader using this method The SimpleFileAdapter implementa
219. ted_logger gt lt administration gt routing service gt There are more configuration tags that you can use to control Distributed Logger s behavior For example you can specify a filter so that only certain types of log messages are published For details see the RTI Distributed Logger Getting Started Guide Support for Extensible Types Routing Service includes partial support for the Extensible and Dynamic Topic Types for DDS specification from the Object Management Group OMG This section assumes that you are familiar with Extensible Types and you have read the Core Libraries and Utilities Getting Started Guide Addendum for Extensible Types 1 Topic Routes can subscribe to and publish topics associated with final and extensible types 1 RTI Monitor is a separate CUI application that can run on the same host as your application or on a different host 2 http www omg org spec DDS XTypes 2 37 2 7 Support for Extensible Types LJ You can select the type version associated with a topic route by providing the type description in the XML configuration file The XML description supports structure inher itance If you have the Connext Core Libraries and Utilities you can learn more about struc ture inheritance in the Core Libraries and Utilities Getting Started Guide Addendum for Extensible Types L The TypeConsistencyEnforcementQosPolicy can be specified on a per topic route basis in the same way as othe
220. that can remotely control Routing Service The lt administra tion gt tag is used to enable remote administration and configure its behavior By default remote administration is turned off in Routing Service for security reasons A remote administration section is not required in the configuration file For example lt dds gt lt routing service gt lt administration gt lt domain_id gt 55 lt domain_id gt save path home david mysaved config xml save path lt administration gt routing service gt lt dds gt When remote administration is enabled Routing Service will create a DomainParticipant Pub lisher Subscriber DataWriter and DataReader These entities are used to receive commands and send responses You can configure these entities with QoS tags within the lt administration gt tag Table 2 6 lists the tags allowed within lt administration gt tag Notice that the lt domain_id gt tag is required For more details please see Chapter 5 Administering Routing Service from a Remote Location Note The command line options used to configure remote administration take precedence over the XML configuration see Table 3 1 on page 3 2 Table 2 6 Remote Administration Tags TT Number Tags within TT administration Description of Tags Allowed A boolean that if true automatically triggers a save command when configuration updates are received It is false by default This value is mutable w
221. the directory of the Java Virtual Machine dynamic library to your environment variable LD_LIBRARY_PATH on UNIX based systems or Path on Win dows systems For example setenv LD_LIBRARY_PATH S LD_LIBRARY PATH local java jdk1 5 0_07 jre 1ib i386 client Creating a Build Script for UNIX based Systems In this section you will create a shell script to compile the Java adapter 1 Create a directory that will contain the build script and the adapter implementation The rest of this section assumes that you will use opt adapters simplefile as the adapter directory 2 In opt adapters simplefile create a file called build sh with the following content bin sh THEHHEHUERHERHUREH HERE ED BEER DH E D EREEEERE E HER E RHERHEEREHERHERER HE HERE 1 See lt Connext installation directory ndds version doc pdf RTI CoreLibrariesAndUtilities ReleaseNotes pdf 8 3 Creating New Adapters RTI Routing Service File Simple Adapter HH FEE HEHEHE HE HE HE HE HE HE HE HE HE HEHE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HEHE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HEHE HE HEHE HEH HE HHH HHH HHHH FEFE FE HE HE HE HE HE HE HE FE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE E E E HE E E E HE HE HE HE HE HE HE HE HE HE HE HE HE HE H H HH H HHHH Java compiler JAVAC javac JAR jar Path to RTI Routing Service Adapter API ADAPTER_CLASSPATH SROUTINGSERVICEHOME class rtirsadapter jar
222. the session threads using the route s StreamWriters 6 17 6 3 Monitoring Status Table 6 7 DomainRouteStatusSet Field Name Description output_bytes_per_s Statistic variable that provides information about the output bytes per second across routes Output bytes refer to the bytes that are published out by the session threads using the route s StreamWriters The variable only considers the bytes of the serialized samples Pro tocol headers UDP RTPS are not included latency_s Statistic variable that provides information about the latency in seconds across routes The latency in a route refers to the time elapsed between the sample read and write This is a good metric to monitor the health and performance of transformations 1 The throughput measured in bytes can only be computed if the samples are DynamicData samples If not only the throughput measured in samples per second is available This statement applies to all the statistic variables described in this chapter that measure throughput in bytes per second 6 3 4 Status Information for a Session The topic that publishes session status is called rti routing service monitoring session status set The session status aggregates the statistics of the routes contained in it the mean of the means in the routes the absolute maximum and minimum across routes the mean of the standard devia tion and the total count The I
223. tion import com rti routingservice adapter Session import com rti routingservice adapter StreamReader import com rti routingservice adapter StreamReaderListener import com rti routingservice adapter StreamWriter import com rti routingservice adapter infrastructure AdapterException import com rti routingservice adapter infrastructure StreamInfo Simple file connection public class SimpleFileAdapterConnection implements Connection private String verbosity private String directory null BA SimpleFileAdapterConnection Properties properties String verbosity throws AdapterException this verbosity verbosity directory properties getProperty directory if directory null throw new AdapterException 0 directory property is required ay public Session createSession Properties properties throws AdapterException We dont need a session for the simple file adapter but we cannot return null return new Session public void update Properties properties throws AdapterException E public void deleteSession Session session throws AdapterException public StreamReader createStreamReader Session session StreamInfo streamInfo Properties properties StreamReaderListener listener throws AdapterException if verbosity equals debug System out println CALL getClass getName createStreamReader 8 43 8 3 Creating New Ad
224. tion file This parameter is required unless you use remoteAdministrationDomainld and noAutoEnable domainIdBase ID Sets the base domain ID This value is added to the domain IDs in the configuration file For example if you set domainIdBase to 50 and use domain IDs 0 and 1 in the configuration file then the Routing Service will use domains 50 and 51 Default 0 help Displays help information identifyExecution Appends the host name and process ID to the service name provided with the appName option This helps ensure unique names for remote administration and monitoring For example MyRoutingService myhost 20024 licenseFile lt file gt Specifies the license file path and filename Only applicable to licensed versions of Routing Service If not specified Routing Service looks for the license as described in Installing the License File Section 2 3 in the Getting Started Guide maxObjectsPerThread int Parameter for the DomainParticipantFactory noAutoEnable Starts Routing Service in a disabled state Use this option if you plan to enable Routing Service remotely as described in the User s Manual This option overwrites the value of the enable attribute in the routing service tag remoteAdministrationDomainId ID Enables remote administration and sets the domain ID for remote com munication When remote administration is enabled Routing S
225. tion file with a single route that reads a HelloWorld text file from an input directory and saves it into an output directory 1 If you have not done it yet compile and build the SimpleFileAdapter 2 Under the adapter project directory c adapters SimpleFileAdapter on Windows sys tems opt adapters simplefile on UNIX based systems create two directories called input and output 3 In the input directory create a file called HelloWorld txt with the following content ello World 1 ello World 2 ello World 3 ello World 4 ello World 5 ello World 6 ello World 7 ello World 8 ello World 9 TDOH Hd odi dodi d m Ti 1 Your directory may be different if you did not use the default locations 8 33 8 3 Creating New Adapters Hello World 10 4 In the adapter project directory create a Routing Service XML configuration file called simple_file_adapter xml with the following content Replace the value of the directory property under both connections with the location of the input and output directories Replace the content of the dll tag under adapter_plugin with the location of the release version of the SimpleFileAdapter shared library lt xml version 1 0 gt lt dds gt lt adapter library name adapters gt adapter plugin name simple file gt dll c adapters SimpleFileAdapter Release SimpleFileAdapter d1l lt dll gt create function gt SimpleFileAdapter create lt create funct
226. tion of return_loan is empty because of these reasons e The read operation does not create new samples and it always return a single sam ple stored in the StreamReader e Two calls to read cannot occur in parallel update The update methods will be called when the read_period is changed using remote administration a file called SimpleFileAdapterStreamReader java under Adapter directory gt rout ingservice adapter simplefile Insert the following content KKK SA Simple File Adapter Stream Reader ESA package routingservice adapter simplefile import import import import import import import import import import import import public pr java io File java io BufferedReader java io FileReader java io IOException java util List java util Properties com rti dds dynamicdata DynamicData com rti dds typecode TypeCode com rti routingservice adapter StreamReader com rti routingservice adapter StreamReaderListener com rti routingservice adapter infrastructure AdapterException com rti routingservice adapter infrastructure StreamInfo class SimpleFileAdapterStreamReader implements StreamReader ivate String verbosity 1 c adapters SimpleFileAdapter for Windows systems or opt adapters simplefile for UNIX based systems 8 46 8 3 Creating New Adapters private int readPeriod private String fileName null private BufferedReader fileReader null
227. tional Table 8 5 Session Operations Operation Description Updates the configuration of a session update This method is called when the update command is received by the routing service ses sion lt session gt tag containing the adapter session see Section 5 2 12 Implementation of this API is optional 8 2 Adapter API And Entity Model Table 8 6 StreamReader Operations Operation Description The StreamReader API is required only when the adapter is used to receive data Otherwise it is optional update Updates the configuration of a StreamReader providing a new set of properties This method is called after the update command is received by the routing service route containing the StreamReader see Section 5 2 12 Implementation of this API is optional read Reads a collection of data samples and sample infos from the StreamReader When Routing Service is done using the samples it will return the loan to the Stream Reader by calling return_loan Implementation of this API is required if the adapter is used to receive data return_loan Returns the loan on the read samples and infos Routing Service calls this method to indicate that it is done accessing the collection of data samples and sample infos obtained by an earlier invocation to read Implementation of this API is required if the adapter is used to receive data Table 8 7 StreamWriter Op
228. tor the state of a Routing Service instance is an important tool that allows you to detect problems For example looking at the latency statistics for a route might show you that the performance of a transformation in the route is not as expected Looking at the input sam ples per second in the different sessions you might see that one session is receiving most of the traffic In that case you could reassign some of the routes to other sessions to improve load bal ancing Routing Service can publish status for the following kinds of entities 1 Routing Service itself lt routing_service gt 2 Domain Route lt domain_route gt 3 Session session 4 Route route and topic route 5 Topic Route auto route and auto topic route For each of the above kinds of entities Routing Service creates two topics I rti routing service monitoring tag data describes the entity s configuration L rti routing service monitoring tag status set describes the entity s operational status With the corresponding types L RTI RoutingService Monitoring lt tag gt Data I RTI RoutingService Monitoring lt tag gt StatusSet Where lt tag gt is one of the following entity kind tags RoutingService DomainRoute Session Route or AutoRoute 6 1 6 1 Enabling Remote Monitoring 6 1 6 2 Enabling Remote Monitoring By default remote monitoring is disabled in Routing Service for security and performance rea sons
229. ugging it Debugging the Adapter with GDB only for UNIX based systems Let s see how to debug the adapter library with gdb using the SimpleFileAdapter implemented in Section 8 3 3 1 Go to the directory containing the SimpleFileAdapter makefile and build the debug ver sion of the shared library as follows gt gmake clean gt gmake DEBUG 1 The debug version of the adapter replaces the release version because is generated in the same location 2 Edit the configuration file simple_file_adapter xml generated in Section 8 3 3 8 and replace the library in the lt dll gt tag with the debug version of the adapter For example dll opt adapters simplefile lib i86Linux2 6gcc4 4 5 libsimplefileadapter so lt dl1 gt 3 Run gdb gt gdb SROUTINGSERVICEHOME bin i86Linux2 69cc4 4 5 rtiroutingservice 4 Insert breakpoints in the functions that you want to debug For example gdb b SimpleFileAdapter create connection Function SimpleFileAdapter create connection not defined Make breakpoint pending on future shared library load y or nl y Breakpoint 1 SimpleFileAdapter create connection pending 5 Execute Routing Service and debug your adapter gdb r cfgFile simple file adapter xml cfgName file to file Java Adapter API This section does not intend to give complete information on the entire Java API but rather to describe the aspects of the Java API that are specific to the Java language For detailed informat
230. ugins are registered they can be used to create connections within a domain route see Section 2 4 2 For example dds routing service name Routerl group_name Group1 gt domain route name DomainRoutel gt connection 1 plugin name MyAdapterLibrary MyCAdapterPlugin gt connection 1 connection 2 plugin name MyAdapterLibrary MyJavaAdapter connection 2 session name Session gt session domain route routing service gt dds 8 2 Adapter API And Entity Model There are five main classes in the adapter class model 1 Adapter An Adapter is a factory for Connections See Table 8 3 Adapter Operations on page 8 5 2 Connection A Connection provides access to a data domain such as a DDS domain or JMS provider network and is a factory for Sessions StreamReaders and StreamWriters In the builtin DDS adapter a Connection is mapped to a DomainParticipant In an XML configuration file connections are associated with the tags connection 1 and connection 2 within a domain route see Section 2 4 2 See Table 8 4 Connection Operations on page 8 5 8 2 8 2 Adapter API And Entity Model Table 8 1 C Adapter Plugin Tags us Number Tags within in adapter plugin Description Mns Required Shared library containing the implementation of the adapter plugin The dll tag may specify the exact name of the file for e
231. ute name is like entity name but must be a domain route entity p1 p2 specifies if the DomainParticipant associated with participant 1 or participant 2 configuration is selected peer list is a comma separated list of peers create create target routing service domain route session topic route auto route parent entity name xml url remote local The create command is similar to update Section 5 2 12 but the configuration is applied to a newly created entity instead of an existing one The second parameter domain route session topic route auto route is the kind of entity to be created If the kind is a domain route there will be no parent For the other kinds session topic route or auto route a parent entity name must be specified 1 As defined by the POSIX fnmatch API 1003 2 1992 section B 6 5 3 5 2 Remote Commands 5 2 3 5 2 4 5 2 5 lt xml_url gt and remote local are the same as used in update Section 5 2 12 except that only XML snippets matching the entity kind are allowed A full file starting with lt dds gt is not valid For example this would be entered as a single command with no line breaks create example topic route DomainRoute Session str topic route name TrianglesToTriangles gt input participant 1 gt lt registered type name gt ShapeType registered type name topic name Triangle topic name gt lt input gt
232. va heap sizes Oor1 monitoring Enables and configures general remote monitoring General monitor ing settings are applicable to all the Routing Service entities unless they are explicitly overridden See Monitoring Section 2 4 4 Oorl 2 7 2 4 XML Tags for Configuring Routing Service 2 4 2 Domain Route A domain route defines a mapping between two data domains Data available in either of these data domains can be routed to the other one For example a domain route could define a mapping between two different DDS domains or between a DDS domain and a JMS provider s network How this data is actually read and written is defined in spe cific routes A domain route creates two connections known as connection_1 and connection_2 Each connection belongs to one of the two data domains For example lt dds gt lt routing service name Routerl group_name Group1 gt domain route name DomainRoutel gt lt connection 1 plugin name gt lt connection_1 gt lt connection 2 plugin name gt connection 2 session name Session gt session domain route routing service dds domain route 1 1 1 1 registered type lt property gt lt connection_2 gt i registered type 7 7 lt property gt The connection tags require the specification of the attribute plugin_name which will be used to associate a c
233. ved by the TestAdapter is not between a defined range when you stop Rout ing Service you will see a failure message Success or failure is determined when you stop Routing Service and it destroys the adapter To use the TestAdapter to test your input adapter 1 Write a configuration file in which your adapter is the input for one or more routes and the TestAdapter is the output Configure the TestAdapter with the expected number of samples within a range speci fied using the properties MinExpectedSamples and MaxExpectedSamples in the out put tag 2 Run Routing Service using that configuration file 3 Wait the amount of time your adapter may require 4 Stop Routing Service The TestAdapter will print a failure or success message You can avoid steps 3 4 by starting Routing Service with the stopAfter seconds command line option If you run Routing Service with verbosity 3 or higher the TestAdapter will also print the DynamicData samples as they arrive For an example of how to use and configure the TestAdapter see Routing Service home example testing test adapter xml This example tests the simple C file adapter introduced in previous sections You can also write your own adapter to extend the TestAdapter class The source code is in rtirs adapter jar Chapter 9 Propagating Content Filters Figure 9 1 Routing Service can be configured to propagate the content filter information associated with user
234. xample lib libmyadapter so or a general name no file extension which will be com pleted as follows dll value dir myadapter dir Final Path UNIX based systems dir libmyadapter so 1 e Final Path Windows systems dir myadapter dll If the library specified with the lt dll gt tag cannot be opened because the library path is not in the Path environment variable on a Windows system or the LD_LIBRARY_PATH environment variables on a UNIX based system Routing Service will look for the library in lt Routing Service installation directory gt bin lt architecture gt Required This tag must contain the name of the function used to create the adapter plu create function gin 1 The function must be implemented in the adapter shared library Sequence of name value string pairs that can be used to configure the parameters of the adapter For example property value property lt element gt Oorl lt name gt username lt name gt lt value gt myusername lt value gt lt element gt lt value gt lt property gt Table 8 2 Java Adapter Plugin Tags HS Number n Tags within Description of Tags java adapter plugin Allowed Required Name of the class that implements the adapter plugin For example com rti adapters MSAdapter class name The classpath required to run the Java adapter must be part of the Rout 1 ing Service JVM configuration See Routing Service Tags Table 2 2 for additional information on
235. xcept in this case the TCP connections can be initi ated only by the Routing Service instance in LANI For security reasons incoming connections to LANI are not allowed Figure 7 4 shows how to configure the TCP transport in this scenario 7 3 7 1 TCP Communication Scenarios Figure 7 4 Asymmetric Communication Across NATs n AAA parent classid NDDS_TRANSPORT_ Participant 7 parent classid CLASSID_TCPV4_WAN ESO NDDS_TRANSPORT_ TCPv4 Transport CLASSID_TCPV4_WAN Participant TCPv4 Transport IP address public_address lt unset gt 192 168 1 11 IP address public address server bind port 0 use usu 18 181 0 32 8500 Unreachable node Initial Peers Reachable node server bind port 7400 18 181 0 32 8500 1 11 Connection lt Data NAT Router NAT Router Initial Peers lt unset gt WAN IP address WAN IP address 18 181 0 32 18 181 0 31 Public Server Bind Port 8500 Portforward settings WAN port 8500 to 192 168 5 11 7400 Notice that the Routing Service on LAN 1 now does not have a public address set and its server_bind_port is set to zero meaning that it cannot be reached from the outside network 7 1 4 Secure Communication Security can be added on top of any of the above scenarios You can have secure communication within the same LAN or across NATs To enable secure communication modify the previous configurations as follows 1 Change the transport class
236. y tools The rest of this section shows how to debug a Java adapter using jdb the command line debugger of Java and NetBeans IDE 6 9 Enabling Debugging in the Routing Service JVM Before you start debugging with jdb or NetBeans you have to enable debugging in the JVM cre ated Routing Service 1 If you have not done so already stop the existing Routing Service execution by pressing CTRL C 2 Edit java_simple_adapter xml and replace the content of the JVM tag with lt jvm gt class path lt element gt class simplefileadapter jar lt element gt lt class_path gt lt options gt lt element gt Xdebug lt element gt lt element gt Xrunjdwp transport dt socket address 8192 server y suspend y lt element gt lt options gt lt jvm gt The JVM option Xdebug is used to enable debugging The JVM option Xrunjdwp loads the JDPA reference implementation of JDWP Java Debug Wire Protocol and starts listening on port 8192 to communicate with a separate debugger application such as jdb and NetBeans For additional details on Java debugging see http java sun com javase technologies core toolsapis jpda 3 Save the changes 4 Run Routing Service On UNIX based systems gt cd lt SimpleFileAdapter project directory gt gt SROUTINGSERVICEHOME scripts rtiroutingservice cfgFile simple file adapter xml cfgName file to file On Windows systems cd SimpleFileAdapter project directory gt
237. z x B alc Indicates whether or not the StreamWriter associated with a route is created Contains the configuration of the route s output that is specific to either the DDS adapter or a generic adapter output When a generic output is defined lt route gt lt output gt then the union dis adapter data criminator is RTI ROUTING SERVICE GENERIC ADAPTER KIND if it is a DDS output topic route output or route dds output then the union discriminator is RII ROUTING SERVICE DDS ADAPTER KIND output o DDS output only Domain ID of the output participant domain_id e M DDS output only Unique identifier for the DataWriter dart cm The value of this field is only meaningful when datawriter state is datawriter key RII ROUTING SERVICE CREATED AND ENABLED output adapter data Not applicable for DDS output The properties used to configure this route s generic StreamWriter specified with the tag lt property gt inside route output property 6 9 6 2 Monitoring Configuration Data Table 6 4 RouteData 6 2 5 Field Name Description List of transformations associated with a route For each transformation you will be able to retrieve the transformation plugin name and the properties transformations F act Transformations are defined using the lt transformation gt tag inside lt route gt or lt topic_route gt Note in this version only one transfo

Download Pdf Manuals

image

Related Search

Related Contents

User Manual - RhinoCo Technology  テレビを お好みの設定にする  DEWALT DW124 Use and Care Manual  Samsung DIGIMAX L55W Kullanıcı Klavuzu  Guida per l`utente per Windows  Tacens TANGO  Mag-Bind® Stool DNA Kit - Omega Bio-Tek  Leisure LEVC54  AE1125/12 Philips Portable Radio  ダウンロード - 中川電気工業  

Copyright © All rights reserved.
Failed to retrieve file