Operator WebSocketInject

IBMStreams com.ibm.streamsx.inet Toolkit > com.ibm.streamsx.inet 2.9.6 > com.ibm.streamsx.inet.wsserver > WebSocketInject

Operator recieves messages from WebSocket clients and generates a tuple which is sent to streams. Each received message is output as tuple. The data received is dependent upon the input ports schema.

Summary

Ports
This operator has 0 input ports and 1 output port.
Windowing
This operator does not accept any windowing configurations.
Parameters
This operator supports 5 parameters.

Required: port

Optional: ackCount, initDelay, messageAttribute, senderIdAttribute

Metrics
This operator reports 2 metrics.

Properties

Implementation
Java

Output Ports

Assignments
Java operators do not support output assignments.
Ports (0)

First attribute will have the message received via the WebSocket, of type rstring. Second attribute (if provided) will have the senders unique id, or type rstring.Subsequent attribute(s) are allowed and will not be poplulated.

Properties

Parameters

This operator supports 5 parameters.

Required: port

Optional: ackCount, initDelay, messageAttribute, senderIdAttribute

ackCount

The operator sends out an ack message to all currently connected clients. An ack message is sent when the (totaslNumberOfMessagesRecieved % ackCount) == 0, The ack message is a in JSON format { status:'COUNT', text:<totalNumberOfMessagesReceived>}. Default value is 0, no ack messages will be sent.

Properties
initDelay

Delay in seconds before the operator starts producing tuples.

Properties
messageAttribute

Input port's attribute that the data received will be stored to. If the port has more than one attribute this parameter is required.

Properties
port

WebSocket network port that messages arrive on. The WebSocket client(s) use this port to transmit on.

Properties
senderIdAttribute

Input port attribute that will we loaded with the message sender's identifier, this identifier is consistent during the lifetime of the sender's session.

Properties

Metrics

nClientsConnected - Gauge

Number of clients currently connected to WebSocket port.

nMessagesReceived - Counter

Number of messages received via WebSocket

Libraries

Operator class library
Library Path: ../../impl/lib/com.ibm.streamsx.inet.jar, ../../opt/wssupport/Java-WebSocket-1.3.0.jar