lib/fluent/plugin/out_wendelin.rb in fluent-plugin-wendelin-0.3 vs lib/fluent/plugin/out_wendelin.rb in fluent-plugin-wendelin-0.4
- old
+ new
@@ -36,20 +36,28 @@
# by default credentials are not used
# TODO user/password -> certificate
config_param :user, :string, :default => nil
config_param :password, :string, :default => nil
+ config_param :use_keep_alive, :bool, :default => false
+ config_param :ssl_timeout, :integer, :default => 60
+ config_param :open_timeout, :integer, :default => 60
+ config_param :read_timeout, :integer, :default => 60
+ config_param :keep_alive_timeout, :integer, :default => 300
+
def configure(conf)
super
credentials = {}
if @user
credentials['user'] = @user
credentials['password'] = @password
end
- @wendelin = WendelinClient.new(@streamtool_uri, credentials, @log)
+ @wendelin = WendelinClient.new(@streamtool_uri, credentials, @log,
+ @ssl_timeout, @open_timeout,
+ @read_timeout, @keep_alive_timeout)
end
def start
super
# TODO
@@ -78,10 +86,14 @@
# for input_stream_ref use tag as-is - it will be processed/translated
# further on server by Wendelin
reference = tag
- @wendelin.ingest(reference, data_chunk)
+ if @use_keep_alive
+ @wendelin.ingest_with_keep_alive(reference, data_chunk)
+ else
+ @wendelin.ingest(reference, data_chunk)
+ end
end
end
end