CSV Socket Reader Input Adapter

Introduction

The CSV Socket Reader is an embedded adapter that reads CSV data from a socket. It closely resembles the CSV File Reader adapter.

Unlike the CSV File Reader adapter, though, this socket adapter reads input data from a TCP socket connected to a specified external address. Also unlike the file reader, the input source of this adapter is indefinite and naturally timed, so repetition and timing are not specified as properties.

Properties

Property Description
Host Name The host or IP address to connect to.
Port The TCP port to connect to.
Field Delimiter The delimiter used to separate tokens, defaults to a comma. Control characters can be entered as &#ddd; where ddd is the character's ASCII value.
String Quote Character Matching pairs of the quote character delimit string constants.
Timestamp Format The format used to parse timestamp fields extracted from the input file. This should be in the form expected by the java.text.SimpleDateFormat class described in the Sun Java Platform SE reference documentation.

If a timestamp value is read that does not match the specified format string, the entire record is discarded and a WARN message appears on the console that includes the text invalid timestamp value.

Log Level 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, and ALL.
All Truncation Warnings

DEPRECATED. String lengths were removed as of StreamBase 6.3.0, so this property is no longer necessary and should not be used in new instances of this adapter. This property is preserved in the adapter so that applications that defined it can continue to pass typechecking.

Schema (in the Edit Schemas tab) Specifies the schema of the incoming CSV file.

Typechecking and Error Handling

Typechecking will fail if the Delimiter or QuoteChar are not single character strings, or if the TimestampFormat is malformed.

Suspend/Resume Behavior

On suspend, this adapter closes its input socket.

On resumption, it reconnects its socket and continues reading tuples from it.

This adapter does not leave its socket open during suspend because the input source is naturally timed, so the input source itself cannot be paused. Leaving the socket open could lead to buffering problems, ultimately causing the socket to close with an error.