logstash-integration-rabbitmq 7.3.2-java → 7.4.0-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d87b910943f6be19026320fcad93686f4583361f394f4ce5415415bc99faaac3
4
- data.tar.gz: f6dce144b898f2a818f8e9bc0751adc1e467f98ddf002abb6eedbf64f24242bd
3
+ metadata.gz: f8b1b48521b0094de4590f515bf7a0e5b100c31437dfcfd6441054e663a862c3
4
+ data.tar.gz: cface3e3fa3835787b3f9ca5d9e5447e65d8c2a0473445a41a7984beab07ac56
5
5
  SHA512:
6
- metadata.gz: 2de6023c6ae0ab82548a8933ed89771ebc839a24320e13065e177a12d488f29e329e0ef9983854600c03f28c67f49fcf627ecf92556a8839abbdae9255195d62
7
- data.tar.gz: f0071bfa48a4b2f2c3727bef2543f06c9e88ef92d7a662606f782fccb508028d25f3bd3a7c6107a43334ae86d75ebf0ff6526d27ff400d5035dababf83189977
6
+ metadata.gz: f94cf03c38e5a6668898cf90cb76f94a56b97c49a150c54a1ed058bd1e8ebd0c6df1061bf4629bb6c93347698a373285d3c28a5ec6acfa263656e44920ecd7ac
7
+ data.tar.gz: e63a13e0164a381817198b8adf84b149fc278ce7b57b00ba7ed0dc7388b6dbff1a0b9fc5151e1cc488af19eb4ad3e2eb0593ee051157edc175678148f2027521
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 7.4.0
2
+ - Removed obsolete `verify_ssl` and `debug` options [#60](https://github.com/logstash-plugins/logstash-integration-rabbitmq/pull/60)
3
+
4
+ ## 7.3.3
5
+ - Fixed the cancellation flow to avoid multiple invocations of basic.cancel [#55](https://github.com/logstash-plugins/logstash-integration-rabbitmq/pull/55)
6
+
1
7
  ## 7.3.2
2
8
  - Change `tls_certificate_password` type to `password` to protect from leaks in the logs [#54](https://github.com/logstash-plugins/logstash-integration-rabbitmq/pull/54)
3
9
 
@@ -308,7 +308,14 @@ module LogStash
308
308
  end
309
309
 
310
310
  def shutdown_consumer
311
- return unless @consumer
311
+ # There are two possible flows to shutdown consumers. When the plugin is the one shutting down, it should send a channel
312
+ # cancellation message by invoking channel.basic_cancel(consumer_tag) and waiting for the consumer to terminate
313
+ # (broker replies with an basic.cancel-ok). This back and forth is handled by MarchHare. On the other hand, when the broker
314
+ # requests the client to shutdown (eg. due to queue deletion). It sends to the client a basic.cancel message, which is handled
315
+ # internally by the client, unregistering the consumer and then invoking the :on_cancellation callback. In that case, the plugin
316
+ # should not do anything as the consumer is already cancelled/unregistered.
317
+ return if !@consumer || @consumer.cancelled? || @consumer.terminated?
318
+
312
319
  @hare_info.channel.basic_cancel(@consumer.consumer_tag)
313
320
  connection = @hare_info.connection
314
321
  until @consumer.terminated?
@@ -54,18 +54,12 @@ module LogStash
54
54
  # Version of the SSL protocol to use.
55
55
  config :ssl_version, :validate => :string, :default => "TLSv1.2"
56
56
 
57
- config :verify_ssl, :validate => :boolean, :default => false,
58
- :obsolete => "This function did not actually function correctly and was removed." +
59
- "If you wish to validate SSL certs use the ssl_certificate_path and ssl_certificate_password options."
60
-
61
57
  # Path to an SSL certificate in PKCS12 (.p12) format used for verifying the remote host
62
58
  config :ssl_certificate_path, :validate => :path
63
59
 
64
60
  # Password for the encrypted PKCS12 (.p12) certificate file specified in ssl_certificate_path
65
61
  config :ssl_certificate_password, :validate => :password
66
62
 
67
- config :debug, :validate => :boolean, :obsolete => "Use the logstash --debug flag for this instead."
68
-
69
63
  # Set this to automatically recover from a broken connection. You almost certainly don't want to override this!!!
70
64
  config :automatic_recovery, :validate => :boolean, :default => true
71
65
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-integration-rabbitmq'
3
- s.version = '7.3.2'
3
+ s.version = '7.4.0'
4
4
  s.licenses = ['Apache License (2.0)']
5
5
  s.summary = "Integration with RabbitMQ - input and output plugins"
6
6
  s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline "+
@@ -63,6 +63,62 @@ describe LogStash::Inputs::RabbitMQ do
63
63
  expect(instance.codec.config_name).to eq "json"
64
64
  end
65
65
 
66
+ describe "and #stop is called" do
67
+ let(:consumer_tag) { "foo-bar-queue" }
68
+ let(:consumer) { double("consumer") }
69
+
70
+ before do
71
+ instance.register
72
+ instance.setup!
73
+ instance.instance_variable_set(:@consumer, consumer)
74
+
75
+ allow(instance).to receive(:close_connection)
76
+ allow(consumer).to receive(:consumer_tag).and_return(consumer_tag)
77
+ end
78
+
79
+ context "with a cancelled consumer" do
80
+ before do
81
+ allow(consumer).to receive(:cancelled?).and_return(true)
82
+ allow(consumer).to receive(:terminated?).and_return(false)
83
+ end
84
+
85
+ it "should not call basic_cancel" do
86
+ expect(channel).to_not receive(:basic_cancel)
87
+ instance.stop
88
+ end
89
+ end
90
+
91
+ context "with a terminated consumer" do
92
+ before do
93
+ allow(consumer).to receive(:cancelled?).and_return(false)
94
+ allow(consumer).to receive(:terminated?).and_return(true)
95
+ end
96
+
97
+ it "should not call basic_cancel" do
98
+ expect(channel).to_not receive(:basic_cancel)
99
+ instance.stop
100
+ end
101
+ end
102
+
103
+ context "with a running consumer" do
104
+ before do
105
+ allow(consumer).to receive(:cancelled?).and_return(false)
106
+ allow(consumer).to receive(:terminated?).and_return(false, false, true)
107
+ end
108
+
109
+ it "should call basic_cancel" do
110
+ expect(channel).to receive(:basic_cancel).with(consumer_tag)
111
+ instance.stop
112
+ end
113
+
114
+ it "should log terminating info" do
115
+ allow(channel).to receive(:basic_cancel).with(consumer_tag)
116
+ expect(instance.logger).to receive(:info).with(/Waiting for RabbitMQ consumer to terminate before stopping/, anything)
117
+ instance.stop
118
+ end
119
+ end
120
+ end
121
+
66
122
  describe "#connect!" do
67
123
  subject { hare_info }
68
124
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-integration-rabbitmq
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.3.2
4
+ version: 7.4.0
5
5
  platform: java
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-30 00:00:00.000000000 Z
11
+ date: 2024-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -20,8 +20,8 @@ dependencies:
20
20
  - !ruby/object:Gem::Version
21
21
  version: '2.99'
22
22
  name: logstash-core-plugin-api
23
- prerelease: false
24
23
  type: :runtime
24
+ prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
@@ -37,8 +37,8 @@ dependencies:
37
37
  - !ruby/object:Gem::Version
38
38
  version: 6.5.0
39
39
  name: logstash-core
40
- prerelease: false
41
40
  type: :runtime
41
+ prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - ">="
@@ -51,8 +51,8 @@ dependencies:
51
51
  - !ruby/object:Gem::Version
52
52
  version: '0'
53
53
  name: logstash-codec-json
54
- prerelease: false
55
54
  type: :runtime
55
+ prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - ">="
@@ -65,8 +65,8 @@ dependencies:
65
65
  - !ruby/object:Gem::Version
66
66
  version: '4.0'
67
67
  name: march_hare
68
- prerelease: false
69
68
  type: :runtime
69
+ prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - "~>"
@@ -79,8 +79,8 @@ dependencies:
79
79
  - !ruby/object:Gem::Version
80
80
  version: 0.0.22
81
81
  name: stud
82
- prerelease: false
83
82
  type: :runtime
83
+ prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - "~>"
@@ -93,8 +93,8 @@ dependencies:
93
93
  - !ruby/object:Gem::Version
94
94
  version: '1.0'
95
95
  name: back_pressure
96
- prerelease: false
97
96
  type: :runtime
97
+ prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - "~>"
@@ -107,8 +107,8 @@ dependencies:
107
107
  - !ruby/object:Gem::Version
108
108
  version: '2.0'
109
109
  name: logstash-devutils
110
- prerelease: false
111
110
  type: :development
111
+ prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - "~>"
@@ -121,8 +121,8 @@ dependencies:
121
121
  - !ruby/object:Gem::Version
122
122
  version: '0'
123
123
  name: logstash-input-generator
124
- prerelease: false
125
124
  type: :development
125
+ prerelease: false
126
126
  version_requirements: !ruby/object:Gem::Requirement
127
127
  requirements:
128
128
  - - ">="
@@ -135,8 +135,8 @@ dependencies:
135
135
  - !ruby/object:Gem::Version
136
136
  version: '0'
137
137
  name: logstash-codec-plain
138
- prerelease: false
139
138
  type: :development
139
+ prerelease: false
140
140
  version_requirements: !ruby/object:Gem::Requirement
141
141
  requirements:
142
142
  - - ">="
@@ -217,7 +217,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
217
217
  - !ruby/object:Gem::Version
218
218
  version: '0'
219
219
  requirements: []
220
- rubygems_version: 3.2.33
220
+ rubygems_version: 3.3.26
221
221
  signing_key:
222
222
  specification_version: 4
223
223
  summary: Integration with RabbitMQ - input and output plugins