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.
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 SimpleDateFormat class. For more information, see the com.streambase.sb.adapter.Adapter class description in the StreamBase Java API documentation.

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.