I understand Kiba's core is to process rows 1 by 1. And I want this, until the destination step. I want to push the transformed data to a Kafka Topic, however it's preferred to do it in Bulk rather than individually. Is this possible?
Assumming we have the next class
class TransactionProducer
def intialize(data: [])
@data = data
end
def push_to_kafka
$kafka.push(data)
end
end
I think
this is possible using post_process
and storing the transformed data in an array.
data = []
job = Kiba.parse do
source MySource, source_config
transform do |row|
row = Transform...
data << row
end
post_process do
TransactionProducer.new(data).push_to_kafka
end
end
But im wondering if there's another way?