doujiang24/lua-resty-kafka

有没有办法在body_filter或者log阶段使用kafka?

ZxyNull0 opened this issue · 1 comments

2024/04/08 09:41:12 [error] 2892575#0: *1 failed to run body_filter_by_lua*: /usr/local/openresty/lualib/resty/kafka/broker.lua:125: API disabled in the context of body_filter_by_lua*
stack traceback:
	[C]: in function 'tcp'
	/usr/local/openresty/lualib/resty/kafka/broker.lua:125: in function 'send_receive'
	/usr/local/openresty/lualib/resty/kafka/client.lua:183: in function '_fetch_metadata'
	/usr/local/openresty/lualib/resty/kafka/client.lua:266: in function 'fetch_metadata'
	/usr/local/openresty/lualib/resty/kafka/producer.lua:123: in function 'choose_partition'
	/usr/local/openresty/lualib/resty/kafka/producer.lua:379: in function 'send'

可以通过放在定时器里面去调用