...
Existing Extensions
Scai
Sick
PQL - Sender
To publish processed data with PQL the SENDER
-Operator is needed. This operator takes care of the application depending and transport depending transformation and delivery of the processed elements in the data stream.
The following parameters are required in the SENDER-Operator:
Parameter
Wrapper
This parameter allows the selection of the wrapper that is responsible for the delivery of the data. In Odysseus the default wrappers are GenericPush and GenericPull. Other extensions provide further names.
Transport
The transport handler is responsible for the delivery of the processed data stream elements at a given endpoint.
Protocol
The protocol handler is responsible for the transformation of the processed sensor data elements into an application depending protocol to transport them over a given transport protocol to an endpoint.
DataHandler
The data handler transforms the elements in a data stream to the right representations (I.e. String or Byte Array). Depending on the protocol handler a specific data handler may be required. However, in most cases the data handler Tuple should be adequate.
Options
The options field includes additional parameter for the transport and protocol handlers.
Example
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
output = SENDER({
wrapper='GenericPush',
transport='TCPClient',
protocol='CSV',
dataHandler='Tuple',
options=[['host', 'example.com'],['port', '8081'],['read', '10240'],['write', '10240']]
}, input) |
Available Protocol Handler
CSV
The CSV protocol handler parses comma separated text lines.
Options:
delimiter: The delimiter for splitting the input
skipfirstline: Skip the first line of input
Available Transport Handler
TCPClient
Description
The TCPClient transport handler allows the delivery of results over TCP/IP to an arbitrary host. This transport handler can be used in both directions, connecting to a server to receive data and connect to a server to publish data.
Options
host: The host/IP of the target
port: The port of the target system
read: The size of the read buffer
write: The size of the write buffer
Example
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
input = ACCESS({source='Source',
wrapper='GenericPush',
transport='TCPClient',
protocol='CSV',
dataHandler='Tuple',
options=[['host', 'example.com'],['port', '8080'],['read', '10240'],['write', '10240']],
schema=[
['id', 'Double'],
['data', 'String']]
})
output = SENDER({wrapper='GenericPush',
transport='TCPClient',
protocol='CSV',
dataHandler='Tuple',
options=[['host', 'example.com'],['port', '8081'],['read', '10240'],['write', '10240']]
}, input) |
TCPServer
Description
The TCPServer transport handler allows the propagation of results over TCP/IP as a server. This transport handler can be used in both directions, other client can connect to this server to receive data and to publish data.
Options
port: The port to listen for connections
read: The size of the read buffer
write: The size of the write buffer
Example
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
input = ACCESS({source='Source',
wrapper='GenericPush',
transport='TCPServer',
protocol='CSV',
dataHandler='Tuple',
options=[['port', '8080'],['read', '10240'],['write', '10240']],
schema=[
['id', 'Double'],
['data', 'String']]
})
output = SENDER({wrapper='GenericPush',
transport='TCPServer',
protocol='CSV',
dataHandler='Tuple',
options=[['port', '8081'],['read', '10240'],['write', '10240']]
}, input) |
UDPClient
Description
The UDPClient transport handler allows the delivery of results over UDP/IP to an arbitrary host. This transport handler can only be used in one direction, to publish data over UDP.
Options
host: The host/IP of the target
port: The port of the target system
write: The size of the write buffer
Example
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
output = SENDER({wrapper='GenericPush',
transport='UDPClient',
protocol='CSV',
dataHandler='Tuple',
options=[['host', 'example.com'],['port', '8080'],['write', '10240']]
}, input) |
UDPServer
Description
The UDPServer transport handler allows the propagation of results over UDP/IP as a server. This transport handler can only be used in one direction, other UDP clients can send data to this server to publish data.
Options
Port: The port to listen for data
read: The size of the read buffer
Example
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
input = ACCESS({source='Source',
wrapper='GenericPush',
transport='UDPServer',
protocol='CSV',
dataHandler='Tuple',
options=[['port', '8080'],['read', '10240']],
schema=[
['id', 'Double'],
['data', 'String']]
}) |