lib/fluent/plugin/mqtt_output_mixin.rb in fluent-plugin-mqtt-io-0.2.2 vs lib/fluent/plugin/mqtt_output_mixin.rb in fluent-plugin-mqtt-io-0.2.3
- old
+ new
@@ -18,10 +18,12 @@
base.config_param :topic_rewrite_pattern, :string, :default => nil
base.config_param :topic_rewrite_replacement, :string, :default => nil
base.config_param :bulk_trans_sep, :string, :default => "\t"
base.config_param :send_time, :bool, :default => false
base.config_param :send_time_key, :string, :default => "send_time"
+ base.config_param :initial_interval, :integer, :default => 1
+ base.config_param :retry_inc_ratio, :integer, :default => 2
end
require 'mqtt'
# This method is called before starting.
@@ -31,14 +33,14 @@
super
init_retry_interval
end
def init_retry_interval
- @retry_interval = 1
+ @retry_interval = @initial_interval
end
def increment_retry_interval
- @retry_interval = @retry_interval * 2
+ @retry_interval = @retry_interval * @retry_inc_ratio
end
def sleep_retry_interval(e, message)
$log.error "#{message},#{e.class},#{e.message}"
$log.error "Retry in #{@retry_interval} sec"