The PLC4X Connector streams data from and to any device accessible through the PLC4X interface.
See config/source.properties
for example configuration.
See config/sink.properties
for example configuration.
Download the latest version of Apache Kafka binaries from here: https://kafka.apache.org/downloads
Unpack the archive.
Copy the target/apache-kafka-0.4.0-SNAPSHOT.jar to the Kafka “libs” directory.
Copy the files in the “config” to Kafka's “configs” directory (maybe inside a “plc4x” subdirectory)
Open 4 console windows and change directory into that directory
Start Zookeeper:
bin/zookeeper-server-start.sh config/zookeeper.properties
Start Kafka:
bin/kafka-server-start.sh config/server.properties
Create the “test” topic:
bin/kafka-topics.sh --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic test
Start the consumer:
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test --from-beginning
Note: Not quite sure here ... have to continue working on this ...
Start Kafka connect:
bin/connect-standalone.sh config/connect-standalone.properties config/plc4x/source.properties
Now watch the console window with the “kafka-console-consumer”.
If you want to debug the connector, be sure to set some environment variables before starting Kafka-Connect:
export KAFKA_DEBUG=y; export DEBUG_SUSPEND_FLAG=y;
In this case the startup will suspend till an IDE is connected via a remote-debugging session.