Routing Service Socket Adapter in java

8 posts / 0 new
Last post
Offline
Last seen: 2 years 6 months ago
Joined: 02/25/2019
Posts: 13
Routing Service Socket Adapter in java

I have modified the rti provided example in java of simplefileadapter in routing service for socket to dds communication.

My problem is that

In NotificationThread StreamReaderListener object is not invoking read function on line

listener.onDataAvailable(reader);

i have attached source code plz have a look on this. When i am running this adapter it is creating stream reader and also calling notification thread but when i am sending data on socket port it is not calling read function.

AttachmentSize
File simplefileadapterstreamreader.java6.32 KB
Offline
Last seen: 2 years 6 months ago
Joined: 02/25/2019
Posts: 13

Is there anyone who can help me on this.

asanchez's picture
Offline
Last seen: 4 years 6 months ago
Joined: 11/16/2011
Posts: 50

Hi sujeets77,

Could you run RoutingService with -verbosity 3 and post the output?

- Antonio

Offline
Last seen: 2 years 6 months ago
Joined: 02/25/2019
Posts: 13

Here i am posting verbosity output: ---plz see

 

$NDDSHOME/bin/rtiroutingservice -cfgFile /root/Documents/socket_dds.xml -cfgName socket_to_dds -verbosity 3
ROUTER_BUILD_5.3.0.0_20170622T204835Z_RTI_REL
Loading /opt/rti_connext_dds-5.3.0/resource/xml/RTI_ROUTING_SERVICE.xml
Loading /root/Documents/socket_dds.xml
Remote configuration enabled on domain 0
DL Notice: : ROUTERService_startMonitoring:service status publication started
DL Notice: : Plugin LOADED OK: adapters::simple_file (version 0.0.0) from Java class routingservice/adapter/simplefile/SimpleFileAdapter
Jun 22, 2019 9:10:53 AM routingservice.adapter.simplefile.SimpleFileAdapterConnection <init>
SEVERE: I am in Connection Class
Jun 22, 2019 9:10:53 AM routingservice.adapter.simplefile.SimpleFileAdapterConnection <init>
SEVERE: I am Datagram Socket
DL Notice: : ROUTERLegacyConnection_getInputStreamDiscoveryReader:!get legacy input discovery stream reader
DL Notice: : ROUTERLegacyConnection_getOutputStreamDiscoveryReader:!get legacy output discovery stream reader
DL Notice: : Plugin LOADED OK: rti.routingservice.RoutingProcessor (version 5.3.0) from library
DL Notice: : ROUTERTopicRoute_startMonitoring: [socketdds::session::route] status publication started
DL Notice: : [socketdds::session::route] Route enabled
DL Notice: : ROUTERSession_startMonitoring: [session] status publication started
DL Notice: : ROUTERDomainRoute_startMonitoring: [socketdds] status publication started
DL Notice: : [socketdds] Domain route STARTED
DL Notice: : ROUTERService_start:Service started OK (name=socket_to_dds, group_name=RTI_RoutingService_sujsin_10598)
DL Debug: : RTI Routing Service 5.3.0 started (with name socket_to_dds)
Jun 22, 2019 9:10:53 AM routingservice.adapter.simplefile.SimpleFileAdapterConnection createStreamReader
SEVERE: I am in Creating StreamReaderObject
Jun 22, 2019 9:10:53 AM routingservice.adapter.simplefile.SimpleFileAdapterStreamReader <init>
SEVERE: I am in StreamReader Class constructor
DL Notice: : [socketdds::session::route::input_0] Route input enabled for stream HelloWorld
Jun 22, 2019 9:10:54 AM routingservice.adapter.simplefile.SimpleFileAdapterStreamReader$NotificationThread run
SEVERE: I am in Notification Thread
DataPacket Length 131
Jun 22, 2019 9:11:01 AM routingservice.adapter.simplefile.SimpleFileAdapterStreamReader$NotificationThread run
SEVERE: I am in Notification Thread
DataPacket Length 131
Jun 22, 2019 9:11:02 AM routingservice.adapter.simplefile.SimpleFileAdapterStreamReader$NotificationThread run
SEVERE: I am in Notification Thread
DataPacket Length 131
Jun 22, 2019 9:11:03 AM routingservice.adapter.simplefile.SimpleFileAdapterStreamReader$NotificationThread run
SEVERE: I am in Notification Thread
DataPacket Length 131
Jun 22, 2019 9:11:04 AM routingservice.adapter.simplefile.SimpleFileAdapterStreamReader$NotificationThread run
SEVERE: I am in Notification Thread
DataPacket Length 131
Jun 22, 2019 9:11:05 AM routingservice.adapter.simplefile.SimpleFileAdapterStreamReader$NotificationThread run
SEVERE: I am in Notification Thread
DataPacket Length 131
Jun 22, 2019 9:11:06 AM routingservice.adapter.simplefile.SimpleFileAdapterStreamReader$NotificationThread run
SEVERE: I am in Notification Thread
DataPacket Length 131
Jun 22, 2019 9:11:07 AM routingservice.adapter.simplefile.SimpleFileAdapterStreamReader$NotificationThread run
SEVERE: I am in Notification Thread
DataPacket Length 131
Jun 22, 2019 9:11:08 AM routingservice.adapter.simplefile.SimpleFileAdapterStreamReader$NotificationThread run
SEVERE: I am in Notification Thread
DataPacket Length 131
Jun 22, 2019 9:11:09 AM routingservice.adapter.simplefile.SimpleFileAdapterStreamReader$NotificationThread run
SEVERE: I am in Notification Thread
DataPacket Length 131
Jun 22, 2019 9:11:10 AM routingservice.adapter.simplefile.SimpleFileAdapterStreamReader$NotificationThread run
SEVERE: I am in Notification Thread
DataPacket Length 132
Jun 22, 2019 9:11:11 AM routingservice.adapter.simplefile.SimpleFileAdapterStreamReader$NotificationThread run
SEVERE: I am in Notification Thread
DataPacket Length 132
Jun 22, 2019 9:11:12 AM routingservice.adapter.simplefile.SimpleFileAdapterStreamReader$NotificationThread run
SEVERE: I am in Notification Thread
DataPacket Length 132
Jun 22, 2019 9:11:13 AM routingservice.adapter.simplefile.SimpleFileAdapterStreamReader$NotificationThread run
SEVERE: I am in Notification Thread
DataPacket Length 132
Jun 22, 2019 9:11:14 AM routingservice.adapter.simplefile.SimpleFileAdapterStreamReader$NotificationThread run
SEVERE: I am in Notification Thread
DataPacket Length 132
Jun 22, 2019 9:11:15 AM routingservice.adapter.simplefile.SimpleFileAdapterStreamReader$NotificationThread run
SEVERE: I am in Notification Thread
DataPacket Length 132
Jun 22, 2019 9:11:16 AM routingservice.adapter.simplefile.SimpleFileAdapterStreamReader$NotificationThread run
SEVERE: I am in Notification Thread

Offline
Last seen: 2 years 6 months ago
Joined: 02/25/2019
Posts: 13

do i need to write my own StreamReaderListener function ondataavailable(). i have posted verbosity output plz see.

asanchez's picture
Offline
Last seen: 4 years 6 months ago
Joined: 11/16/2011
Posts: 50

Hi Sujeets77,

From the RS log I can deduce that your Route is not running. This means that it probably has not received the type information. You want to make sure that these types are available in both the input and output, and you can provide that by using XML or through discovery (see User's manual configuration section for details on how to do this).

Also you need to make sure that the stream/topic names match the ones of your publisher and subscriber application. 

Once both conditions above are met, you should see a log from RS that will look like this:

DL Notice:  [socketdds::session::route] route running

That means your route is ready to forward data. In that case, you need to make sure data is being published from the corresponding communication side. 

- Antonio

Offline
Last seen: 2 years 6 months ago
Joined: 02/25/2019
Posts: 13

Thank you very much for your help.

I have defined the types structure in same socket_dds.xml file, did you mean that routing service will publish only those topic which have any subscriber application expecting that topic, i dont think so.

asanchez's picture
Offline
Last seen: 4 years 6 months ago
Joined: 11/16/2011
Posts: 50

Hi Sujeets,

Yes in your current setup you will need to create a DDS subscriber so it can receive the information through Routing Service from your publishing socket.

- Antonio