logstash-input-bunny 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ac9146e066c41f5b0467ff05cfa44e36ca7871e2
4
- data.tar.gz: 6c5856787b8e9e5a6463d89304c306cc9310f305
3
+ metadata.gz: d7a0cd2906d0c9403b16a32f5d9186ea37b4e82a
4
+ data.tar.gz: 3521871aae65252dd3287142f3e6b4e11f46caee
5
5
  SHA512:
6
- metadata.gz: e82bac4394d2b19576e15f9dccc83456a743e4152005a27ae15217ec494c628c334a42a82b0ae5b3815f04122de64b8de0a646b1dc9a3d9fdc9ff57926425535
7
- data.tar.gz: 055bcba3bd538d184a5f7cce712892cb1f080f39eb4289a32c29f1362883574321cc1f8e3384de6fd608cf1e88061219d7a5fb927d9eeb253d7af205fcb76039
6
+ metadata.gz: f3f4133716e815eb3b8d18183e2919a0eb0c13baffe7d5f5688b2f0e7d5faf59888a98cb51c70cdd6e1ab9a3d843888c69380ca38227bc39f9ee5b05a5ca3022
7
+ data.tar.gz: 450dd7462b4c447876d510871ddd88373cca3ddc3c8251ab074fd631eed5929756d918a29d9401810e5c230611e3a02552ea01b8de0ad7b9c440e078d71e1618
@@ -129,5 +129,25 @@ class LogStash::Inputs::Bunny < LogStash::Inputs::Threadable
129
129
  @settings[:verify_peer] = @verify_peer
130
130
  end
131
131
  end
132
+
133
+ def consume
134
+ consumer_id = "#{`hostname -s`.strip}-#{Thread.current.object_id}"
135
+ @logger.info("Will consume events from queue #{@q.name} as #{consumer_id}")
136
+
137
+ no_ack = !@ack
138
+ exclusive = @exclusive
139
+
140
+ @consumer = Bunny::Consumer.new(@ch, @q, consumer_id, no_ack, exclusive)
141
+ @consumer.on_delivery do |delivery_info, properties, data|
142
+ @codec.decode(data) do |event|
143
+ decorate(event)
144
+ @output_queue << event
145
+ end
146
+
147
+ @ch.acknowledge(delivery_info.delivery_tag) if @ack
148
+ end
149
+
150
+ @q.subscribe_with(@consumer, block: true)
151
+ end
132
152
  end # class LogStash::Inputs::RabbitMQ
133
153
 
@@ -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.3'
4
+ s.version = '0.1.4'
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"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-bunny
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Serafini