ronething commented on code in PR #8693:
URL: https://github.com/apache/apisix/pull/8693#discussion_r1089675533
##########
apisix/plugins/error-log-logger.lua:
##########
@@ -272,6 +333,52 @@ local function send_to_clickhouse(log_message)
end
+local function create_producer(broker_list, broker_config, cluster_name)
+ core.log.info("create new kafka producer instance")
+ return producer:new(broker_list, broker_config, cluster_name)
+end
+
+
+local function send_to_kafka(log_message)
+ core.log.info("sending a batch logs to kafka brokers: ",
+ core.json.delay_encode(config.kafka.brokers))
+
+ local broker_config = {}
+ broker_config["request_timeout"] = config.timeout * 1000
+ broker_config["producer_type"] = config.kafka.producer_type
+ broker_config["required_acks"] = config.kafka.required_acks
+
+ local metadata = plugin.plugin_metadata(plugin_name)
Review Comment:
> It looks like we might use m2 as key and c1 as value in the cache below.
if you mean that we need to clone `config` before we use it like below? then
we can use m2 and c2 in `send`.
`local conf = core.table.clone(config)`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]