doujiang24 / lua-resty-kafka

Lua kafka client driver for the Openresty based on the cosocket API
BSD 3-Clause "New" or "Revised" License
801 stars 274 forks source link

send result success, in customer not thing #38

Open sakmon opened 7 years ago

sakmon commented 7 years ago

this is my code , the result show: send success, offset: true but in customer i can't get anything; location ^~/1 { default_type 'text/html'; access_log off; access_by_lua ' local producer = require "resty.kafka.producer" local broker_list = { { host = "192.168.210.24", port = 6667 }, { host = "192.168.210.25", port = 6667 }, } local producer_config = {producer_type = "async"} local p = producer:new(broker_list , producer_config) local offset, err = p:send("usertrajectory" , nil , "1111111111111111111112222222222" ) if not offset then ngx.say("send err:", err) return end ngx.say("send success, offset: ", offset) return '; }

yamyamyuo commented 7 years ago

@doujiang24 I recently have similar problem. I my application, the nginx message send to kafka, but one of my kafka broker failed. Instead of searching for another available broker, the resty just not working and did not show any error logs. My kafka could not receive any message. When the failed kafka working again, things going well. Why is it like this? Do you know what's the issue?