TCP Output
The TCP output plugin is used to make HTTP requests. It can be configured to send information when a query finds a match.
Parameters
address: REQUIRED. The address of the remote TCP server. (Or localhost if making a local request).
delimiter: OPTIONAL. The character that separates fields. If not provided, the default is a comma.
port: REQUIRED. The port number on the host TCP server.
queue_capacity: OPTIONAL. If a remote TCP server is not responding, or taking too long to respond, request could begin to pile up. RioDB is used in a variety of high-performance use cases, so there could be a use-case where you would pile up a queue of millions of requests waiting to be sent. The queue_capacity sets a limit to prevent JVM running out of memory.
workers: OPTIONAL. How many CPU threads to handle making TCP requests. The default is 1, and usually that’s all you need.
Syntax
OUTPUT http (
address <string>
delimiter <single character>
port <integer>
queue_capacity <integer>
workers <integer>
Example
A simple output tab-delimited records to myremoteapi.com:9999 for every message received by STREAM mystream:
SELECT session_id
FROM mystream
OUTPUT tcp (
address 'myremoteapi.com'
delimiter ' '
port 9999
queue_capacity 1000000
workers 3
Note, if using multiple workers, it is not guaranteed that requests will arrive at the remote host in the same order as the stream queries fired. Due to network connectivity, a request may experience delay and arrive after a subsequent request. If ordering is important, stick to 1 single worker.