Closed noahyao1024 closed 8 years ago
I have solve this by watching other ISSUE! Thank you for your fantanstic extension!
Note for this issue: nginx directive "resolver" should be added to the level from which this code is executed (be it http or location).
considered solved :)
Nginx.conf ngx.say("[start lua kafka]") local cjson = require "cjson" local client = require "resty.kafka.client" local producer = require "resty.kafka.producer" local broker_list = { { host = "127.0.0.1", port = 9094}, } local topic = "hellokafka"; local cli = client:new(broker_list) local brokers, partitions = cli:fetch_metadata(topic)
Output: [start lua kafka] [fetch_metadata] brokers: [null,{"host":"cp01-rdqa-dev340.cp01.baidu.com","port":9094}]; partitions: {"errcode":0,"num":1,"0":{"id":0,"errcode":0,"replicas":[2],"isr":[2],"leader":2}}; [send message] send err:no resolver defined to resolve "cp01-rdqa-dev340.cp01.baidu.com"
Can't resolve the Hostname? Please Help me...