Skip to main content

ConnectWebSocket

Description

Acts as a WebSocket client endpoint to interact with a remote WebSocket server. FlowFiles are transferred to downstream relationships according to received message types as WebSocket client configured with this processor receives messages from remote WebSocket server. If a new flowfile is passed to the processor, the previous sessions will be closed and any data being sent will be aborted.

Tags

WebSocket, consume, listen, subscribe

Properties

In the list below required Properties are shown with an asterisk (*). Other properties are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.

Display NameAPI NameDefault ValueAllowable ValuesDescription
WebSocket Client ControllerService *websocket-client-controller-serviceController Service:
WebSocketClientService

Implementations:
JettyWebSocketClient
A WebSocket CLIENT Controller Service which can connect to a WebSocket server.
WebSocket Client Id *websocket-client-idThe client ID to identify WebSocket session. It should be unique within the WebSocket Client Controller Service. Otherwise, it throws WebSocketConfigurationException when it gets started.

Dynamic Properties

This component does not support dynamic properties.

Relationships

NameDescription
binary messageThe WebSocket binary message output
connectedThe WebSocket session is established
failureFlowFile holding connection configuration attributes (like URL or HTTP headers) in case of connection failure
successFlowFile holding connection configuration attributes (like URL or HTTP headers) in case of successful connection
text messageThe WebSocket text message output

Reads Attributes

This processor does not read attributes.

Writes Attributes

NameDescription
websocket.controller.service.idWebSocket Controller Service id.
websocket.endpoint.idWebSocket endpoint id.
websocket.local.addressWebSocket client address.
websocket.message.typeTEXT or BINARY.
websocket.remote.addressWebSocket server address.
websocket.session.idEstablished WebSocket session id.

State Management

This component does not store state.

Restricted

This component is not restricted.

Input Requirement

This component allows an incoming relationship.

System Resource Considerations

This component does not specify system resource considerations.

See Also