Skip to content

Instantly share code, notes, and snippets.

@blurredbits
Created June 30, 2015 18:28
Show Gist options
  • Select an option

  • Save blurredbits/7fe67db6594a0dd1abf5 to your computer and use it in GitHub Desktop.

Select an option

Save blurredbits/7fe67db6594a0dd1abf5 to your computer and use it in GitHub Desktop.

Revisions

  1. blurredbits created this gist Jun 30, 2015.
    12 changes: 12 additions & 0 deletions producer.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    #!/usr/bin/env ruby

    require 'poseidon'

    producer = Poseidon::Producer.new(["localhost:9092"], "test_producer")

    loop do
    messages = []
    messages << Poseidon::MessageToSend.new("metrics", "timestamp: #{Time.now.to_i}, metric: #{rand(10..30)}")
    producer.send_messages(messages)
    sleep 3
    end