Created
November 6, 2018 20:45
-
-
Save ifyouseewendy/40a0f31a305dde152d822894e4917444 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "bundler/setup" | |
require "kafka" | |
def foo(msg) | |
puts "=="*50 | |
kafka = Kafka.new( | |
seed_brokers: ["shopify.railgun:9092"], | |
client_id: "flow_rails_whatever", | |
logger: Logger.new(STDOUT) | |
) | |
producer = kafka.producer | |
producer.produce( msg, topic: "flow_runs") | |
producer.deliver_messages | |
rescue => _ | |
end | |
# corrupted | |
puts ">> corrupted" | |
msg = "1" * 32760 | |
foo(msg) | |
puts "<<"*20 | |
# not corrupted | |
puts ">> not corrupted" | |
msg = "1" * 32759 | |
foo(msg) | |
puts "<<"*20 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment