mirror of
https://github.com/elastic/logstash.git
synced 2025-06-28 17:53:28 -04:00
Support for inter-pipeline comms with a new pipeline input/output
This also makes the load / reload cycle of pipelines threadsafe and concurrent in the Agent class. Fixes #9225
This commit is contained in:
parent
8bc137b437
commit
a1c0e417e5
28 changed files with 1062 additions and 120 deletions
|
@ -55,4 +55,39 @@ describe "Test Logstash service when multiple pipelines are used" do
|
|||
expect(File.exist?(temporary_out_file_2)).to be(true)
|
||||
expect(IO.readlines(temporary_out_file_2).size).to eq(1)
|
||||
end
|
||||
|
||||
describe "inter-pipeline communication" do
|
||||
let(:pipelines) do
|
||||
[
|
||||
{
|
||||
"pipeline.id" => "test",
|
||||
"pipeline.workers" => 1,
|
||||
"pipeline.batch.size" => 1,
|
||||
"config.string" => "input { generator { count => 1 } } output { pipeline { send_to => testaddr } }"
|
||||
},
|
||||
{
|
||||
"pipeline.id" => "test2",
|
||||
"pipeline.workers" => 1,
|
||||
"pipeline.batch.size" => 1,
|
||||
"config.string" => "input { pipeline { address => testaddr } } output { file { path => \"#{temporary_out_file_1}\" } }"
|
||||
}
|
||||
]
|
||||
end
|
||||
it "can communicate between pipelines" do
|
||||
logstash_service = @fixture.get_service("logstash")
|
||||
logstash_service.spawn_logstash("--path.settings", settings_dir, "--log.level=debug")
|
||||
logstash_service.wait_for_logstash
|
||||
|
||||
# Wait for LS to come up
|
||||
i = 0
|
||||
until File.exist?(temporary_out_file_1) && IO.readlines(temporary_out_file_1).size >= 1
|
||||
i += 1
|
||||
sleep 1
|
||||
break if i > 30
|
||||
end
|
||||
expect(IO.readlines(temporary_out_file_1).size).to eq(1)
|
||||
|
||||
puts "Done"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue