carnivore-rabbitmq 0.1.6-java → 0.1.8-java
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: d127681a171c54a31bee1d2e77f9228a47d23d13
|
4
|
+
data.tar.gz: f1c2f43b31d7529bc91608596d5a49c02f483965
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c87dc59fb74f30e53e56811b3c779abd2d135c55c93e8aafadfd1670a57cbf63f2462b1ddadac8d935ac6c6b6dc6af1aae10146ca24d743011be5d7862e5a9da
|
7
|
+
data.tar.gz: 82b8053a6c222b0230b3f19b9490d57ba0faf341bf36587978140b9a4c4d546ecdac3594cfba2224760b7240a950e8e1b737b49bddfbefd06dea3e28ca405209
|
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
|