.. _connect_filestreamconnector: |kconnect-long| FileStream Connectors ===================================== The |kconnect-long| FileStream connector examples are intended to show how a simple connector runs for users getting started with |ak-tm|. .. important:: - Starting with version 6.2.1, the FileStream Sink and Source connector artifacts have been moved out of |kconnect-long|. To run the FileStream connector, you must add the new path in the ``plugin.path`` configuration property as shown in the following example: .. code-block:: text plugin.path=/usr/local/share/kafka/plugins,/usr/share/filestream-connectors - Confluent does not recommend the FileStream Connector for production use. If you want a production connector to read from files, use a `Spool Dir connector `__. The following examples include both a file source and a file sink to demonstrate end-to-end data flow through |kconnect-long|, in a local environment. You can find additional information about this connector in the :platform:`developer guide|connect/devguide.html` as a demonstration of how a custom connector can be implemented. Quick start ----------- For a simple demo of how to use the FileStream connectors, refer to the :platform:`Kafka Connect quick start guide|connect/quickstart.html`. FileSource connector -------------------- The FileSource connector reads data from a file and sends it to |ak-tm|. Beyond the `configurations common to all connectors `__ it takes only an input ``file`` and output ``topic`` as properties. Here is an example configuration: .. codewithvars:: bash name=local-file-source connector.class=FileStreamSource tasks.max=1 file=/tmp/test.txt topic=connect-test This connector reads only one file and sends the data within that file to |ak|. The connector then watches the file for appended updates only. The connector does not reprocess any modification of file lines already sent to |ak|. FileSink connector ------------------ The FileSink connector reads data from |ak| and outputs it to a local file. Multiple topics may be specified as with any other sink connector. The FileSink connector only supports the ``file`` property and the `configurations common to all connectors `__. Here is an example key-value mapping: .. codewithvars:: bash name=local-file-sink connector.class=FileStreamSink tasks.max=1 file=/tmp/test.sink.txt topics=connect-test As messages are added to the topics specified in the configuration, they are produced to a local file as specified in the configuration.