- Head to the confluent directory, prep
cd /Users/Ian/Downloads/confluent-3.3.0
export PATH=/Users/Ian/Downloads/confluent-3.3.0/bin:$PATH
- Start up the relevant Confluent stuff
clear && ./bin/connect-standalone ./etc/schema-registry/connect-avro-standalone.properties ./etc/kafka-connect-jdbc/source-dors.properties
- Run your standalone connector
clear && ./bin/connect-standalone ./etc/schema-registry/connect-avro-standalone.properties ./etc/kafka-connect-jdbc/source-dors.properties
- Wait a minute or two for the connector to get up & running
- You can run a console consumer just to see if there's stuff in the topic
--bootstrap-server localhost:9092 --topic test-dors-jdbc-v_reg_total --from-beginning
- It'll be encoded, so not very readable
- In a new IRB console of the Dors Spike repo
require 'avro_turf/messaging'
avro = AvroTurf::Messaging.new(registry_url: "http://localhost:8081")
require "kafka"
kafka = Kafka.new(seed_brokers: ["localhost:9092"])
topic = "test-dors-jdbc-v_reg_total" #topic = kafka.topics.last may also work, if you don't have any other topics
kafka.each_message(topic: t) do |m|
d = avro.decode(m.value)
# do stuff with that hash
end