WebSocket消息

The WebSocket trigger receives messages over TCP from a WebSocket-supported client, which can include the WebSocketSender transformer in an FMEworkspace, and the following Java or HTML5 web browsers:

  • Internet Explorer 10+
  • Firefox 11+
  • Chrome 16+
  • Safari 6+
  • Opera 12.10+

The WebSocket trigger has two output ports. The success port () can send a message if the trigger receives it successfully. The failure port (x) can send a message if the trigger fails to communicate with the client.

WebSocket Communication Channels

TheWebSocket Serveris located on theFME FlowCore. By default,FME Flowuses the following channels for WebSocket communication:

  • Port: 7078
  • URI:ws://<hostname>:7078/websocket

To configure the WebSocket server for SSL communication, seeConfiguring for HTTPS.

Parameters

Tip  "> TipTo test that your parameters work as expected, clickValidate.
  • Target URL: This field is pre-populated with the URL of theFME FlowWebSocket Server(included with yourFME Flowinstallation). Alternatively, you can connect to a different WebSocket server.
  • Stream ID: Specify the Stream ID for the trigger. The Stream ID allows the WebSocket server to identify messages and connect them to the trigger.

Output Attributes

See Also

Attribute Description
time Event time
source Event type
error.type

(Failure port only) Error type:

  • InvalidMessage: An error occurred while configuring this component, such as missing or malformed values.
  • DeadLetter: An error occured while connecting to an external resource. Examples may include connection issues, invalid credentials, or generic external resource exceptions.
error.message (Failure port only) Error message
message (Success port only) Message content

Messaging Protocol

See Also