dev-resources.site
for different kinds of informations.
Kafka Connect: FileStreamSourceConnector in distributed mode
Published at
8/23/2024
Categories
kafka
kafkaconnect
filestreamsourceconnector
Author
eidher
Author
6 person written this
eidher
open
1) Source connectors: Start our kafka cluster. This is the docker-compose.yml file:
version: '2'
services:
kafka-cluster:
image: landoop/fast-data-dev:cp3.3.0
environment:
ADV_HOST: 127.0.0.1
RUNTESTS: 0
ports:
- 2181:2181 # Zookeeper
- 3030:3030 # Landoop UI
- 8081-8083:8081-8083 # REST Proxy, Schema Registry, Kafka Connect
- 9581-9585:9581-9585 # JMX Ports
- 9092:9092 # Kafka Broker
Create and start the container:
docker-compose up kafka-cluster
2) Create the topic we're going to write to:
docker run --rm -it --net=host landoop/fast-data-dev:cp3.3.0 bash
kafka-topics --create --topic demo-2-distributed --partitions 3 --replication-factor 1 --zookeeper 127.0.0.1:2181
3) In a browser go to 127.0.0.1:3030 -> Connect UI
Create a new connector -> File Source
Paste the next configuration and click the Create button:
name=file-stream-demo-distributed
connector.class=org.apache.kafka.connect.file.FileStreamSourceConnector
tasks.max=1
file=demo-file.txt
topic=demo-distributed
key.converter=org.apache.kafka.connect.json.JsonConverter
key.converter.schemas.enable=true
value.converter=org.apache.kafka.connect.json.JsonConverter
value.converter.schemas.enable=true
4) Create the source file:
Execute docker ps to see the containerId.
docker exec -it <containerId> bash
touch demo-file.txt
echo "add any content" >> demo-file.txt
3) In a browser go to 127.0.0.1:3030 -> Kafka Topics UI
Click the topic defined previously (demo-distributed) and validate the content:
kafkaconnect Article's
30 articles in total
Kafka Connect: FileStreamSourceConnector in distributed mode
currently reading
What is Kafka Connect?
read article
Publish PostgresSQL Data Changes to React with KsqlDB and MQTT
read article
Empowering Your Kafka Connectors: A Guide to Connector Guardian
read article
Running Debezium On Kubernetes
read article
Constant Lag in CDC Pipeline (JDBC Sink Connector)
read article
Kafka Connect sink to OpenSearch/ElasticSearch: how to sink unix timestamps
read article
Kafka 2 CockroachDB via JDBC Sink Connector Blueprint
read article
KSQL with authenticated kafka connect
read article
8 tips to speed up Apache Kafka® Connect development
read article
Showcasing Change Data Capture with Debezium and Kafka
read article
Use your own connector with Twitter and Aiven for Apache Kafka®
read article
Manage Apache Kafka Connect connectors with kcctl
read article
Loading CSV data into Confluent Cloud using the FilePulse connector
read article
Using Kafka Connect JDBC Source: a PostgreSQL example
read article
Kafka Connect JDBC Sink deep-dive: Working with Primary Keys
read article
Kafka Connect: The Magic Behind Mux Data Realtime Exports
read article
An Overview About the Different Kafka Connect Plugins
read article
Heroku Error - H10 App Crashed
read article
Apache Kafka Connect Usage Patterns
read article
Vinted Search Scaling Chapter 1: Indexing
read article
Running a self-managed Kafka Connect worker for Confluent Cloud
read article
Streaming data into Kafka S01/E04 — Parsing log files using Grok Expressions
read article
Kafka Connect - Deep Dive into Single Message Transforms
read article
🎄 Twelve Days of SMT 🎄 - Day 12: Community Transformations
read article
🎄 Twelve Days of SMT 🎄 - Day 11: Predicate and Filter
read article
🎄 Twelve Days of SMT 🎄 - Day 10: ReplaceField
read article
🎄 Twelve Days of SMT 🎄 - Day 9: Cast
read article
🎄 Twelve Days of SMT 🎄 - Day 8: TimestampConverter
read article
🎄 Twelve Days of SMT 🎄 - Day 7: TimestampRouter
read article
Featured ones: