I just test .
kumo.on('should_enqueue_log_record', function(msg, hook_name)
local log_record = msg:get_meta 'log_record'
print('should_enqueue_log_record>queue>log_record.queue -->',log_record.queue)
local campaign = msg:get_meta('campaign')
local queue = msg:get_meta('queue')
local queue = msg:get_meta('mygoon')
local received_from = msg:get_meta('received_from')
print('should_enqueue_log_record: campaign,queue,mygoon,received_from -->',campaign,queue,mygoon,received_from)
if log_record.queue ~= 'kafka' then
-- msg:set_meta('queue', 'kafka')
return true
end
return false
end)
for this code campaign,queue,mygoon,received_from are all nil . it will be only get some infomation from log_reccord .
from the doc :https://docs.kumomta.com/reference/events/should_enqueue_log_record/?h=log_record said :
When enabled, each log record will generate a new Message object with the following attributes:
Sender will be set to the sender of the originating message
Recipient will be set to the recipient of the originating message
the log_record meta value will be set to the Log Record that is being logged
The message body/data will be set to the textual representation of the log record. By default this will be the JSON serialization of the log record, but if you have enabled templating using the per_record parameter to kumo.configure_log_hook then it will be whatever your template evaluated to for that record.
The reception_protocol meta value will be set to “LogRecord”