siddhi-io-tcp-node
v0.0.7
Published
Siddhi io-tcp node client
Downloads
3
Readme
Siddhi IO TCP NODE
Donation
If this project help you reduce time to develop, you can give me a cup of coffee :)
请作者喝杯咖啡。
Example
Siddhi script
@App:name("Example")
@App:description("Example Project")
@source(type = 'tcp', context = '/example', @map(type = 'json'))
define stream ExampleStream (hello string);
@sink(type = 'log', prefix = 'LOGGER-InsiderTrader')
define stream OutputStream(hello string);
@info(name = 'ExampleQuery')
from ExampleStream
insert into OutputStream;
Installation
npm i siddhi-io-tcp-node
or
yarn add siddhi-io-tcp-node
Usage
const { TCPNettyClient } = require("siddhi-io-tcp-node");
const client = new TCPNettyClient({
keepAlive: true,
noDelay: true,
});
await client.connect("127.0.0.1", 9892);
const context = "/example";
const payload = {
hello: "world",
};
client.send(context, payload);
License
MIT