CSV Socket Writer Output Adapter

Introduction

The Spotfire Streaming CSV Socket Writer is an embedded adapter that writes comma-separated value (CSV) data to a socket. It closely resembles the CSV File Writer adapter. Unlike the CSV File Writer adapter, though, this socket adapter writes output data to a TCP socket connected to a specified external address.

Properties

This section describes the properties you can set for this adapter, using the various tabs of the Properties view in StreamBase Studio.

General Tab

Name: Use this required field to specify or change the name of this instance of this component. The name must be unique within the current EventFlow module. The name can contain alphanumeric characters, underscores, and escaped special characters. Special characters can be escaped as described in Identifier Naming Rules. 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 options: This field provides a link to the Cluster Aware tab, where you configure the conditions under which this adapter starts.

Enable Error Output Port: Select this checkbox 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 purpose and function of the component. In the EventFlow Editor canvas, you can see the description by pressing Ctrl while the component's tooltip is displayed.

Adapter Properties

Property Default Description
Server Mode cleared Select this checkbox to have the adapter operate in server mode, listening for and accepting incoming connections from remote clients.
Max Connection Count false The maximum number of simultaneous connections the adapter accepts when in server mode.
Host Name localhost The host or IP address to connect to when not in server mode.
Port 9000 The TCP port to connect to or, when in server mode, to listen on.
Use Default Charset Selected If selected, specifies whether the Java platform default character set is to be used. If cleared, a valid character set name must be specified for the Character Set property.
Character Set None The name of the character set encoding that the adapter is to use to read input or write output.
Capture Transform Strategy FLATTEN The strategy to use when transforming capture fields for this operator: FLATTEN or NEST.
Field Delimiter , The delimiter used to separate tokens.
String Quote Character " Matching pairs of the quote character used to delimit string constants.
Flush Interval 1 How often, in seconds, controls flushing tuples to the network. Set this value to zero to flush immediately.
Null Value Representation null String to write when a field is null.
Throttle Error Messages false Only show a given error message once.
String Quote Option Quote if necessary Determines when string fields are quoted in the CSV file: Quote if necessary, Always quote, or Never quote.
Reconnect Count 0 The number of times the adapter should try to reconnect to the socket when not in server mode. 0 means attempt to reconnect indefinitely.
Poll Frequency 5 The time, in seconds, to wait between reconnect attempts.
Log Level INFO Controls the level of verbosity the adapter uses to issue informational traces to the console. This setting is independent of the containing application's overall log level. Available values, in increasing order of verbosity, are: OFF, ERROR, WARN, INFO, DEBUG, TRACE.
Connection Target Enabled cleared Checking this box enables the use of the following two properties when in server mode. Unchecked, the CSV Socket Writer will behave as normal, and every tuple written will be written out on all existing connections.Checking this box will allow the adapter to identify which unique connection to write data to, based on two fields in the incoming tuple.
Connection Target Enabled cleared Checking this box enables the use of the following two properties when in server mode. Unchecked, the CSV Socket Writer will behave as normal, and every tuple written will be written out on all existing connections.Checking this box will allow the adapter to identify which unique connection to write data to, based on two fields in the incoming tuple.
Remote Hostname Identifier Field Name   The name of the field used to identify the host of the connection to which you will exclusively send data to, when in server mode. Instead of broadcasting to all current connection, targeting will cause only a certain connection to receive the data from the current tuple. This is determined by two fields in the incoming tuple, whose names are specified by this property and by the 'Remote Port Identifier Field Name' property. If this property is left blank it will be ignored and data will be sent to all connections.
Remote Port Identifier Field Name   The name of the field used to identify the port of the connection to which you will exclusively send data to, when in server mode. Instead of broadcasting to all current connections, targeting will cause only a certain connection to receive the data from the current tuple. This is determined by two fields in the incoming tuple, whose names are specified by this property and by the 'Remote Hostname Identifier Field Name' property. If this property is left blank it will be ignored and data will be sent to all connections.

Cluster Aware Tab

Use the settings in this tab to enable this operator or adapter for runtime start and stop conditions in a multi-node cluster. During initial development of the fragment that contains this operator or adapter, and for maximum compatibility with 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.

Concurrency Tab

Use the Concurrency tab to specify parallel regions for this instance of this component, or multiplicity options, or both. The Concurrency tab settings are described in Concurrency Options, and dispatch styles are described in Dispatch Styles.

Caution

Concurrency settings are not suitable for every application, and using these settings requires a thorough analysis of your application. For details, see Execution Order and Concurrency, which includes important guidelines for using the concurrency options.

Typechecking and Error Handling

Typechecking fails in the following circumstances:

  • The Flush Interval is less than zero.

  • More than one string quote character is specified.

  • More than one field delimiter is specified.

  • An illegal string quote option is specified.

  • The Poll Frequency is less than zero.

  • If the adapter is unable to connect to the socket, it emits a warning and attempts to reconnect as per the Reconnect Count property. If it is unable to connect after the configured number of retries, it emits a warning and shuts down.