vx-common-amqp 0.3.1 → 0.3.2

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: 54e3c9dbe252243ef45f59ea7aa87cf5dbffeacf
4
- data.tar.gz: f48f4bdd1a4a5379f784a726f31f8415d975fdaa
3
+ metadata.gz: 2251542292e73fae9c86662ae4b6888e0752d238
4
+ data.tar.gz: 01e1467005dea28437f1a44eedbb0202d8cc9cea
5
5
  SHA512:
6
- metadata.gz: d8f9386fdb87efd6c5dbf7f8a1e8ede4c1a15aa26e6365e0ba34e6337cd55c08ed02501b8f5e1beb1e8ece49677b0f8fc0a285c773334d2a14a585c85cc1b65e
7
- data.tar.gz: 94f7106d5acce4225299d71ab1967779a460791c467ae30969947b9654e9428bc2988e0f57b3f2dae4dcadc06d2d3a2c7f1a2bc074cd9330011b695f2a0916ef
6
+ metadata.gz: a142abeb99aa4f54a4d2135817fe211b28468545dc304b06528de30502951ff897573d21391dbb4b21c245fb729c8bb56028eef5a703ae3692b9cb51e2d18db2
7
+ data.tar.gz: b877c2bf0be744fef8f7e11c34e11f19dde8cbe20fcf799dc0e0f70cbaa0e077b8e860b6c7690e4a4cdfb1675b57c794d4ebd00ab6404ac122fb25ecde608eee
@@ -8,6 +8,7 @@ module Vx
8
8
  consumer_id: self.class.consumer_id,
9
9
  consumer: self.class.consumer_name,
10
10
  multiple: multiple,
11
+ payload: payload,
11
12
  uuid: uuid,
12
13
  }
13
14
  self.class.session.channel.ack delivery_info.delivery_tag, multiple
@@ -18,6 +19,7 @@ module Vx
18
19
  instrumentation = {
19
20
  consumer_id: self.class.consumer_id,
20
21
  consumer: self.class.consumer_name,
22
+ payload: payload,
21
23
  multiple: multiple,
22
24
  requeue: requeue,
23
25
  uuid: uuid,
@@ -14,7 +14,7 @@ module Vx
14
14
  x = declare_exchange
15
15
 
16
16
  instrumentation = {
17
- message: message.inspect,
17
+ payload: message,
18
18
  exchange: x.name,
19
19
  consumer: consumer_name,
20
20
  consumer_id: consumer_id
@@ -18,7 +18,12 @@ module Vx
18
18
  x = declare_exchange
19
19
  q = declare_queue
20
20
 
21
- instrumentation = { exchange: x.name, queue: q.name, consumer: consumer_id }
21
+ instrumentation = {
22
+ exchange: x.name,
23
+ queue: q.name,
24
+ consumer_id: consumer_id,
25
+ consumer: consumer_name
26
+ }
22
27
  instrument("start.consumer.amqp", instrumentation)
23
28
 
24
29
  q.bind(x, bind_options)
@@ -33,16 +38,8 @@ module Vx
33
38
  unpacked = nil
34
39
  delivery_info, properties, payload = q.pop(ack: ack)
35
40
 
36
- instrumentation = {
37
- properties: properties,
38
- consumer_id: consumer_id,
39
- consumer: consumer_name
40
- }
41
-
42
41
  if payload
43
- instrument("unpacking.consumer.amqp", instrumentation) do
44
- unpacked = deserialize_message properties, payload
45
- end
42
+ unpacked = deserialize_message properties, payload
46
43
  end
47
44
 
48
45
  [unpacked, delivery_info, properties]
@@ -57,21 +54,19 @@ module Vx
57
54
  delivery_info, properties, payload = q.pop(ack: ack)
58
55
 
59
56
  if payload
60
- result = nil
61
- uuid = SecureRandom.uuid
57
+ payload = deserialize_message properties, payload
58
+ result = nil
59
+ uuid = SecureRandom.uuid
62
60
 
63
61
  instrumentation = {
64
- properties: properties,
65
62
  consumer_id: consumer_id,
66
63
  consumer: consumer_name,
64
+ payload: payload,
67
65
  uuid: uuid
68
66
  }
69
67
 
70
68
  instrument("start_processing.consumer.amqp", instrumentation)
71
69
  instrument("process.consumer.amqp", instrumentation) do
72
- instrument("unpacking.consumer.amqp", instrumentation) do
73
- payload = deserialize_message properties, payload
74
- end
75
70
  result = run_instance delivery_info, properties, payload, uuid
76
71
  end
77
72
 
@@ -87,6 +82,7 @@ module Vx
87
82
  inst.properties = properties
88
83
  inst.delivery_info = delivery_info
89
84
  inst.uuid = uuid
85
+ inst.payload = payload
90
86
  end.perform payload
91
87
  end
92
88
 
@@ -18,6 +18,7 @@ module Vx
18
18
  attr_accessor :properties
19
19
  attr_accessor :channel
20
20
  attr_accessor :uuid
21
+ attr_accessor :payload
21
22
 
22
23
  @@classes = []
23
24
 
@@ -1,7 +1,7 @@
1
1
  module Vx
2
2
  module Common
3
3
  module AMQP
4
- VERSION = "0.3.1"
4
+ VERSION = "0.3.2"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vx-common-amqp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Galinsky