carnivore-rabbitmq 0.1.6 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/carnivore-rabbitmq/message_collector.rb +12 -2
- data/lib/carnivore-rabbitmq/version.rb +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: 308ba448e6d32bfa33f9530eb68edd44e4bcd9ec
|
4
|
+
data.tar.gz: cecfad045fa6e974081a70107d864ab24ad918a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff8c0c6bd81274722c510d3f14550c4bf45caa995d32f4e46304bf0eec3bd843cf07011f9da0d4bdc97d3c43c5d13d0609d65dc6c989dbb3f31c520d62725920
|
7
|
+
data.tar.gz: bd06708b361af481e579f4e71c97d61dcf87e486d231a6ebf77dbaed105c7580564d799b8cbd99a1c1cc19d1e0c53536f85974a5ee66eb7a9e1a4aeede26a109
|
data/CHANGELOG.md
CHANGED
@@ -30,15 +30,25 @@ module Carnivore
|
|
30
30
|
# @return [TrueClass]
|
31
31
|
def collect_messages
|
32
32
|
queue.subscribe(:block => true, :ack => true) do |info, metadata, payload|
|
33
|
+
if(payload.nil?)
|
34
|
+
payload = metadata
|
35
|
+
metadata = {}
|
36
|
+
end
|
33
37
|
begin
|
34
|
-
payload = MultiJson.load(payload)
|
38
|
+
payload = MultiJson.load(payload).to_smash
|
35
39
|
rescue MultiJson::ParseError
|
36
40
|
warn 'Received payload not in JSON format. Failed to parse!'
|
37
41
|
end
|
38
42
|
debug "Message received: #{payload.inspect}"
|
39
43
|
debug "Message info: #{info.inspect}"
|
40
44
|
debug "Message metadata: #{metadata.inspect}"
|
41
|
-
message_queue <<
|
45
|
+
message_queue << Smash.new(
|
46
|
+
:raw => Smash.new(
|
47
|
+
:info => info,
|
48
|
+
:metadata => metadata
|
49
|
+
),
|
50
|
+
:content => payload
|
51
|
+
)
|
42
52
|
debug "Sending new messages signal to: #{notify} (current queue size: #{message_queue.size})"
|
43
53
|
notify.signal(:new_messages)
|
44
54
|
end
|