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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e2cf3cda2d8c2c6ffd7a1320858e12115a033d82
4
- data.tar.gz: ca021c8138a14cf10af694a2ee595f72380ef538
3
+ metadata.gz: 308ba448e6d32bfa33f9530eb68edd44e4bcd9ec
4
+ data.tar.gz: cecfad045fa6e974081a70107d864ab24ad918a2
5
5
  SHA512:
6
- metadata.gz: 50c6306e89b9cee6590ef9a21cdeed61ce898cb6c715e07a66bdc228e028682b0e46535d61aed9a5918212de39ef00c82d6b2fdc6077e01dee86fbddb5c60e5a
7
- data.tar.gz: a1e3e4efa2da5b1ba6f238e07a4dfdb3b665231b4c6f3046b8aa1d6c40ad47fa11f8eeb6e6fd8d1e30be369d5125d2290c6e7c40e31c850634bd193d46111532
6
+ metadata.gz: ff8c0c6bd81274722c510d3f14550c4bf45caa995d32f4e46304bf0eec3bd843cf07011f9da0d4bdc97d3c43c5d13d0609d65dc6c989dbb3f31c520d62725920
7
+ data.tar.gz: bd06708b361af481e579f4e71c97d61dcf87e486d231a6ebf77dbaed105c7580564d799b8cbd99a1c1cc19d1e0c53536f85974a5ee66eb7a9e1a4aeede26a109
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # v0.1.8
2
+ * Include support for auto extraction
3
+ * Detect received payload correctly based on adapter
4
+
1
5
  # v0.1.6
2
6
  * Fix connection setup when using march_hare
3
7
 
@@ -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 << {:info => info, :metadata => metadata, :payload => payload}
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
@@ -1,6 +1,6 @@
1
1
  module Carnivore
2
2
  module Rabbitmq
3
3
  # Current version of library
4
- VERSION = Gem::Version.new('0.1.6')
4
+ VERSION = Gem::Version.new('0.1.8')
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carnivore-rabbitmq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Roberts