Skip to content

Instantly share code, notes, and snippets.

@jacoelho
Last active July 12, 2016 17:43
Show Gist options
  • Select an option

  • Save jacoelho/194b70a11e234b175febb6522b8dd780 to your computer and use it in GitHub Desktop.

Select an option

Save jacoelho/194b70a11e234b175febb6522b8dd780 to your computer and use it in GitHub Desktop.
topic first step
property :topic, String, name_property: true
property :partitions, Fixnum, default: 3
property :replicas, Fixnum, default: 3
property :zookeeper, String, default: "localhost:2181"
property :directory, String, default: "/kafka"
action :create do
cmd = %W(
#{directory}/bin/kafka-topics.sh
--zookeeper #{zookeeper}
--create
--topic #{topic}
--replication-factor #{replicas}
--partitions #{partitions}
).join(" ")
result = shell_out(cmd)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment