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

create timer_every = ngx.timer.every failed, the value is nil #88

Closed wm045631 closed 4 years ago

wm045631 commented 4 years ago

the version of lua-resty-kafka is v0.0.8

i install nginx by ngx_openresty-1.7.7.2.tar.gz

when i use:

local async_producer = producer:new(broker_list, { producer_type = "async" })

the error message is:

2020/03/17 13:20:14 [error] 1486#0: *261 lua entry thread aborted: runtime error: /usr/servers/eshop-lua/lualib/resty/kafka/producer.lua:354: attempt to call upvalue 'timer_every' (a nil value)
stack traceback:
coroutine 0:
        /usr/servers/eshop-lua/lualib/resty/kafka/producer.lua: in function 'new'

i check the value of timer_every,"local timer_every = ngx.timer.every", the result is nil

but when i "git checkout v0.0.7", everything is ok.

doujiang24 commented 4 years ago

yes, the new release need the ngx.timer.every API, please try the v0.08 with the latest openresty. https://github.com/openresty/lua-nginx-module#ngxtimerevery https://github.com/doujiang24/lua-resty-kafka/pull/83

doujiang24 commented 4 years ago

consider it resolved.