sync or async producer

2022-02-15 Thread frakass
for a producer, is there a principle that when to use sync publishing, and when to use async publishing? for the simple format messages, i have tested both, their performance are almost the same. Thank you. frakass

Re: sync or async producer

2022-02-15 Thread frakass
afka.new("localhost:9092", client_id: "ruby-client", resolve_seed_brokers: true) producer = kafka.producer(required_acks: :all,max_buffer_size: 50_000) 1.times do message = rand.to_s producer.produce(message, topic: "mytest") end producer.deliver_messages Thanks On 2022