Deliver a Stream over three Access framework Operators

Post Reply
Steffenadensis
Posts: 31
Joined: Tue Jul 29, 2014 11:42 am

Deliver a Stream over three Access framework Operators

Post by Steffenadensis » Thu Aug 14, 2014 12:35 pm

Hello,

with this code i'm trying to deliver a Stream over an Odysseus Server to an Odysseus Client and then again to an Odysseus Server.

Shouldn't this work?

It looks like the Client cant connect to the server, which i started just before.


Odysseus:

Code: Select all

#DROPALLQUERIES
#DROPALLSOURCES

#PARSER PQL
#RUNQUERY
arduino ::= ACCESS({source='arduino',
wrapper='GenericPush',
transport='TcpServer',
protocol='simplecsv',
dataHandler='Tuple',
options=[['port', '4000'], ['delimiter','/']],
schema=[
	['MT01','STRING'],
	['timestamp','INTEGER'],
	['U1','FLOAT'],
	['U2','FLOAT'],
	['U3','FLOAT'],
	['U4','FLOAT'],
	['U5','FLOAT'],
	['I','FLOAT'],
	['SolarRadiation','FLOAT'],
	['errorbyte','LONG'],
	['querytime','LONG'],
	['queryretries','LONG'],
	['connectionRetries','DOUBLE']
	]
})

#PARSER CQL
#RUNQUERY
SELECT * FROM arduino;

#PARSER PQL
#RUNQUERY
arduino2 ::= ACCESS({source='arduino2',
wrapper='GenericPush',
transport='TcpServer',
protocol='simplecsv',
dataHandler='Tuple',
options=[['port', '4001'], ['delimiter','/']],
schema=[
	['MT01','STRING'],
	['timestamp','INTEGER'],
	['U1','FLOAT'],
	['U2','FLOAT'],
	['U3','FLOAT'],
	['U4','FLOAT'],
	['U5','FLOAT'],
	['I','FLOAT'],
	['SolarRadiation','FLOAT'],
	['errorbyte','LONG'],
	['querytime','LONG'],
	['queryretries','LONG'],
	['connectionRetries','DOUBLE']
	]
})

#PARSER CQL
#RUNQUERY
SELECT * FROM arduino2;

#PARSER PQL
#QUERY
connect := SENDER({sink='connect',
wrapper='GenericPush',
transport='TCPClient',
protocol='simplecsv',
dataHandler='Tuple',
options=[['host','localhost'], ['port', '4001'], ['delimiter','/']]
}, arduino )

#PARSER CQL
#RUNQUERY
SELECT * FROM connect;

Ruby Source Client:

Code: Select all

require 'socket'

hostname = 'localhost'
port = 4000
str = "MT02/1402667540/60.30/125.25/188.91/261.02/323.31/0.09/88.86/0/45/0/"
connection = TCPSocket.new(hostname, port)
i=0

loop{
	sleep(1)
	connection.puts str + i.to_s
	i+=1
}
Kind regards

T. Steffen

Operating system: Debian GNU/Linux 7.6 (wheezy)

Steffenadensis
Posts: 31
Joined: Tue Jul 29, 2014 11:42 am

Re: Deliver a Stream over three Access framework Operators

Post by Steffenadensis » Thu Aug 14, 2014 12:52 pm

O.k wrong, it do work ^^ maybe i should do an svn update :)
Kind regards

T. Steffen

Operating system: Debian GNU/Linux 7.6 (wheezy)

User avatar
Marco Grawunder
Posts: 272
Joined: Tue Jul 29, 2014 10:29 am
Location: Oldenburg, Germany
Contact:

Re: Deliver a Stream over three Access framework Operators

Post by Marco Grawunder » Thu Aug 14, 2014 1:52 pm

Fine :-)

Steffenadensis
Posts: 31
Joined: Tue Jul 29, 2014 11:42 am

Re: Deliver a Stream over three Access framework Operators

Post by Steffenadensis » Thu Aug 14, 2014 2:11 pm

O.K right know it do not work, i cant specify the Problem, but sometimes it runs and sometimes not.
Moreoften not.
Kind regards

T. Steffen

Operating system: Debian GNU/Linux 7.6 (wheezy)

User avatar
Marco Grawunder
Posts: 272
Joined: Tue Jul 29, 2014 10:29 am
Location: Oldenburg, Germany
Contact:

Re: Deliver a Stream over three Access framework Operators

Post by Marco Grawunder » Thu Aug 14, 2014 2:25 pm

Hmm, the order and time could be relevant.

The server must exist and running before the "client query" can be executed.

#SLEEP can be used to delay the exection of a command.

Is the a stack trace?

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest