lib/fluent/plugin/out_azureeventhubs_buffered.rb in sk-fluent-plugin-azureeventhubs-0.0.23 vs lib/fluent/plugin/out_azureeventhubs_buffered.rb in sk-fluent-plugin-azureeventhubs-0.0.24
- old
+ new
@@ -21,10 +21,11 @@
config_param :type, :string, :default => 'https' # https / amqps (Not Implemented)
config_param :proxy_addr, :string, :default => ''
config_param :proxy_port, :integer,:default => 3128
config_param :open_timeout, :integer,:default => 60
config_param :read_timeout, :integer,:default => 60
+ config_param :max_batch_size, :integer,:default => 100
config_param :message_properties, :hash, :default => nil
def initialize
super
@@ -61,13 +62,15 @@
def multi_workers_ready?
true
end
def write(chunk)
+ records = []
chunk.msgpack_each { |tag, time, record|
- records = []
records.push(record)
- @sender.send_w_properties(records, @message_properties)
+ }
+ records.each_slice(@max_batch_size).each { |group|
+ @sender.send_w_properties(group, @message_properties)
}
end
end
end
\ No newline at end of file