logstash-input-bunny 0.1.10 → 0.1.11
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 +4 -4
- data/lib/logstash/inputs/bunny.rb +45 -8
- data/logstash-input-bunny.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a3d026a10ffe2b4a072e4a5584ef2bd1003db28
|
4
|
+
data.tar.gz: fd96ffef182ced185b47afffaf8a6693272c04db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 478a7b649be84c2b471638313432e8af954d2901aaa748c4c30c4f3324423d39d4fc4d5ff0bbf432723061e9a2eb97e1560bedfbca32c0fc23587e8a1202201c
|
7
|
+
data.tar.gz: 0510b6343762f258e8ad974d1d560d378fe829da547810df178b5c24595073b8f4082ab2606a2c588a62cd79b517e2a47c6463f03d2115ed6fb07a8ea01cdbe8
|
@@ -111,14 +111,6 @@ class LogStash::Inputs::Bunny < LogStash::Inputs::Threadable
|
|
111
111
|
super
|
112
112
|
end
|
113
113
|
|
114
|
-
def consumer_id
|
115
|
-
@consumer_id ||= "#{`hostname -s`.strip}-#{Thread.current.object_id}"
|
116
|
-
end
|
117
|
-
|
118
|
-
def input_name
|
119
|
-
@exchange.nil? or @key.nil? ? queue : "#{@exchange}:#{@key}"
|
120
|
-
end
|
121
|
-
|
122
114
|
include ::LogStash::Inputs::RabbitMQ::BunnyImpl
|
123
115
|
|
124
116
|
def run(output_queue)
|
@@ -175,6 +167,50 @@ class LogStash::Inputs::Bunny < LogStash::Inputs::Threadable
|
|
175
167
|
finished
|
176
168
|
end
|
177
169
|
|
170
|
+
protected
|
171
|
+
|
172
|
+
def consumer_id
|
173
|
+
@consumer_id ||= "#{`hostname -s`.strip}-#{Thread.current.object_id}"
|
174
|
+
end
|
175
|
+
|
176
|
+
def input_name
|
177
|
+
@exchange.nil? or @key.nil? ? queue : "#{@exchange}:#{@key}"
|
178
|
+
end
|
179
|
+
|
180
|
+
def setup
|
181
|
+
return if terminating?
|
182
|
+
|
183
|
+
begin
|
184
|
+
attempts ||= 3
|
185
|
+
|
186
|
+
@logger.debug("RabbitMQ[#{input_name}] connecting.")
|
187
|
+
@conn = Bunny.new(@settings)
|
188
|
+
@conn.start
|
189
|
+
rescue OpenSSL::SSL::SSLError
|
190
|
+
@logger.warn("SSL Handshake failed, retrying.")
|
191
|
+
attempts -= 1
|
192
|
+
retry unless attempts == 0
|
193
|
+
end
|
194
|
+
|
195
|
+
@logger.info("RabbitMQ[#{input_name}] connected at #{@settings[:host]}")
|
196
|
+
@ch = @conn.create_channel.tap do |ch|
|
197
|
+
ch.prefetch(@prefetch_count)
|
198
|
+
end
|
199
|
+
|
200
|
+
@arguments_hash = Hash[*@arguments]
|
201
|
+
@q = @ch.queue(@queue,
|
202
|
+
:durable => @durable,
|
203
|
+
:auto_delete => @auto_delete,
|
204
|
+
:exclusive => @exclusive,
|
205
|
+
:passive => @passive,
|
206
|
+
:arguments => @arguments)
|
207
|
+
|
208
|
+
# exchange binding is optional for the input
|
209
|
+
if @exchange
|
210
|
+
@q.bind(@exchange, :routing_key => @key)
|
211
|
+
end
|
212
|
+
end
|
213
|
+
|
178
214
|
def consume
|
179
215
|
@logger.info("Will consume events from queue #{@q.name} as #{consumer_id}")
|
180
216
|
|
@@ -193,5 +229,6 @@ class LogStash::Inputs::Bunny < LogStash::Inputs::Threadable
|
|
193
229
|
|
194
230
|
@q.subscribe_with(@consumer, block: true)
|
195
231
|
end
|
232
|
+
|
196
233
|
end # class LogStash::Inputs::RabbitMQ
|
197
234
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-input-bunny'
|
4
|
-
s.version = '0.1.
|
4
|
+
s.version = '0.1.11'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "Pull events from a RabbitMQ exchange."
|
7
7
|
s.description = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program"
|