The TIBCO StreamBase® Web Output Adapter allows the system to stream tuple data in
JSON format to one or more connected WebSockets. When this adapter is placed on the
canvas, it will take the schema of the input port and create a WebSocket endpoint
based on the fully qualified path of the adapter, unless specified by the context
path property. For example, if the adapter's path including the container name is
default.module1.weboutput then a WebSocket endpoint is
created at http://localhost:10090/default/module1/weboutput using the default 10090
port. A default web page is created at the root which lists all available endpoints
and their schemas. The root endpoint also provides a test page for each endpoint. To
view the default page, visit http://localhost:10090 when your application is running.
This section describes the properties you can set for this adapter, using the various tabs of the Properties view in StreamBase Studio.
Name: Use this required field to specify or change the name of this instance of this component, which must be unique in the current EventFlow module. The name must contain only alphabetic characters, numbers, and underscores, and no hyphens or other special characters. The first character must be alphabetic or an underscore.
Adapter: A read-only field that shows the formal name of the adapter.
Class name: Shows the fully qualified class name that implements the functionality of this adapter. If you need to reference this class name elsewhere in your application, you can right-click this field and select Copy from the context menu to place the full class name in the system clipboard.
Start with application: If this field is set to Yes
(default) or to a module parameter that evaluates to
true, this instance of this adapter starts as part of the JVM
engine that runs this EventFlow fragment. If this field is set to No or to a module
parameter that evaluates to
false, the adapter
instance is loaded with the engine, but does not start until you send an
epadmin container resume command (or
its sbadmin equivalent), or until you
start the component with StreamBase Manager.
Enable Error Output Port: Select this check box to add an Error Port to this component. In the EventFlow canvas, the Error Port shows as a red output port, always the last port for the component. See Using Error Ports to learn about Error Ports.
Description: Optionally enter text to briefly describe the component's purpose and function. In the EventFlow Editor canvas, you can see the description by pressing Ctrl while the component's tooltip is displayed.
|WebStream Configuration||Edit Button||
Shortcut to the StreamBase Configuration File Editor, used for
adapter configuration or converting an existing application's
|Id Field||string||The field in the incoming tuple which represents the ID of the WebSocket to send this tuple. If this field is not set or is null or empty, then the tuple is sent to all connections.|
|Context Path||string||The context path for this WebSocket endpoint, if empty the fully qualified container path of this operator will be used.|
|Timestamp Format||string||The timestamp format used to convert timestamp fields to JSON.|
Use the settings in this tab to allow this operator or adapter to start and stop based on conditions that occur at runtime in a cluster with more than one node. During initial development of the fragment that contains this operator or adapter, and for maximum compatibility with TIBCO Streaming releases before 10.5.0, leave the Cluster start policy control in its default setting, Start with module.
Cluster awareness is an advanced topic that requires an understanding of StreamBase Runtime architecture features, including clusters, quorums, availability zones, and partitions. See Cluster Awareness Tab Settings on the Using Cluster Awareness page for instructions on configuring this tab.
This section describes how the WebSocket protocol works.
Once connected, the only message the WebSocket accepts is a JSON-formatted string to set the WebSocket's ID.
The ID field is used when input tuples also contain an ID field, and if they match the tuple is sent to this WebSocket. If no ID is set for this WebSocket, then only tuples with no ID field set or a null or empty ID field is sent to this WebSocket.
Only exactly one webstream configuration is allowed per application, which all adapters will use if found.
This example configuration shows a web server that contains all available values.
|Enabled||true/false||If true the web server and all ports are started. If false no web server is started and all operators become no-ops.|
|Port||integer||The port the web server will listen on for connections.|
|IdleTimeoutMS||integer||The amount of time in milliseconds to wait for connections to send data.|
|OutputBufferSize||integer||Set the size of the buffer into which response content is aggregated before being sent to the client.|
|RequestHeaderSize||integer||Set the maximum size of a request header.|
|ResponseHeaderSize||integer||Set the maximum size of a response header.|
|SendServerVersion||true/false||If true, send the Server header in responses.|
|SendDateHeader||true/false||If true, include the date in HTTP headers.|
|SelectorThreads||int||The number of selector threads, or less than or equal to 0 for a default value. Selectors notice and schedule established connection that can make IO progress.|
|AcceptorThreads||int||The number of acceptor threads to use, or -1 for a default value. Acceptors accept new TCP/IP connections. If 0, then the selector threads are used to accept connections.|
|ReuseAddress||true/false||Whether the server socket reuses addresses.|
|LingerTime||integer||The linger time. Use -1 to disable.|
|GZipMimeTypes||string||Set the mime types associated with GZip requests. Blank or missing means do not use GZip.|
|WebSocketAsyncWriteTimeoutMS||integer||The time in milliseconds before a write command times out.|
|WebSocketIdleTimeoutMS||integer||The time in milliseconds before a web socket times out from idle behavior.|
|SecurePort||integer||Set the TCP/IP port used for CONFIDENTIAL and INTEGRAL redirections.|
|* SSLKeyStorePath||string||The file or URL of the SSL keystore.|
|* SSLKeyStorePassword||string||The password for the keystore.|
|* SSLKeyStoreManagerPassword||string||The password (if any) for the specific key within the keystore.|
|* SSLTrustStorePath||string||The file name or URL of the trust store location.|
|* SSLTrustStorePassword||string||The password for the trust store.|
* NOTE: Please refer to http://wiki.eclipse.org/Jetty/Howto/Configure_SSL when setting up SSL.