doujiang24 / lua-resty-kafka

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

no offset and no error #48

Closed jney closed 7 years ago

jney commented 7 years ago

I run the following code:

  local p = producer:new(broker_list)
  local offset, err = p:send(topic, key, body)
  if not offset then
    ngx.log(ngx.ERR, err)
    return ngx.exit(ngx.HTTP_INTERNAL_SERVER_ERROR)
  end

I've got some 500 error, but when i log the error i don't have anything either.

2017/01/20 16:33:02 [error] 10#10: *719 [lua] script.lua:33: , client: 10.10.10.10, server: api.example.com, request: "POST /some/path HTTP/1.1", host: "api.example.com"

I can't figure out how to debug this. any idea ?

jney commented 7 years ago

i figured out the issue. the point is, i created a client i reused for each connection. looks to be a bad approach

outsinre commented 1 year ago

@jney I have the same issue, especially when sending concurrent messages to kafka. Both offset and err are nil.

How did you resolve this issue?