mirror of https://github.com/reiseburo/hermann
26 lines
461 B
Ruby
Executable File
26 lines
461 B
Ruby
Executable File
#!/usr/bin/env ruby
|
|
|
|
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + '/../lib'))
|
|
|
|
require 'rubygems'
|
|
require 'hermann/producer'
|
|
|
|
topic = 'topic'
|
|
brokers = ARGV.first
|
|
|
|
puts ">> Producer#new('#{topic}', '#{brokers}')"
|
|
|
|
p = Hermann::Producer.new(topic, brokers)
|
|
|
|
message = ('b' * 4096) + 'a'
|
|
|
|
puts ">> Producer#push('#{message}') (#{message.size} bytes)"
|
|
r = p.push(message)
|
|
|
|
puts Time.now
|
|
puts "#{r}>> #{r.value(3)}"
|
|
puts Time.now
|
|
|
|
puts "..exiting"
|
|
|