Skip to content

Commit

Permalink
Merge pull request #1337 from fluent/compat-buffer-out_forward
Browse files Browse the repository at this point in the history
fix to convert traditional parameters
  • Loading branch information
repeatedly authored Dec 1, 2016
2 parents caf81ea + bbc8f63 commit 49e8aa0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/fluent/plugin/out_forward.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class ACKTimeoutError < Error; end

Fluent::Plugin.register_output('forward', self)

helpers :compat_parameters

LISTEN_PORT = 24224

desc 'The timeout time when sending event logs.'
Expand Down Expand Up @@ -111,6 +113,8 @@ def initialize
end

def configure(conf)
compat_parameters_convert(conf, :buffer, default_chunk_key: 'tag')

super

unless @chunk_key_tag
Expand Down
18 changes: 18 additions & 0 deletions test/plugin/test_out_forward.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,24 @@ def test_configure
assert_equal TARGET_PORT, node.port
end

def test_configure_traditional
d = create_driver(<<EOL)
self_hostname localhost
<server>
name test
host #{TARGET_HOST}
port #{TARGET_PORT}
</server>
buffer_chunk_limit 10m
EOL
instance = d.instance
assert instance.chunk_key_tag
assert !instance.chunk_key_time
assert_equal [], instance.chunk_keys
assert{ instance.buffer.is_a?(Fluent::Plugin::MemoryBuffer) }
assert_equal( 10*1024*1024, instance.buffer.chunk_limit_size )
end

def test_configure_udp_heartbeat
d = create_driver(CONFIG + "\nheartbeat_type udp")
assert_equal :udp, d.instance.heartbeat_type
Expand Down

0 comments on commit 49e8aa0

Please sign in to comment.