sensu-transport-snssqs-ng 2.1.1 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +4 -2
- data/lib/sensu/transport/snssqs.rb +12 -3
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb050cdeb66bf160f0d2593a15724b0c192fa09d
|
4
|
+
data.tar.gz: 971549110b5c9385749abec84ad6bfd5e4f13294
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8989cb0bcf9e9020fb165bec1709816af38dd7a18187a736c18ffe300a47e7deca7339b325be1528f2c2d2c1e21cdeff05cefdaf9049643058f7bfb418237fa5
|
7
|
+
data.tar.gz: 9a9f3b696dfa0f9ebcbc533f70828bd9c89aed1f735e74ee596c777d77497da4073582fd48447b38dd5080a902e11954dbf6691e7d1b8512edd36fdd724695d7
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
@@ -186,16 +186,24 @@ module Sensu
|
|
186
186
|
# if this is a raw SNS message, it exists in the root of the message and no conversion is needed
|
187
187
|
# if it doesn't, it is an encapsulated messsage (meaning the SNS message is a stringified JSON in the body of the SQS message)
|
188
188
|
begin
|
189
|
-
|
189
|
+
self.logger.debug('[transport-snssqs] msg parse start')
|
190
|
+
unless msg.key? 'message_attributes'
|
190
191
|
# extracting original SNS message
|
191
192
|
tmp_body = ::JSON.parse msg.body
|
193
|
+
self.logger.debug('[transport-snssqs] msg parsed from JSON')
|
192
194
|
# if there is no Message, this isn't a SNS message and something has gone terribly wrong
|
193
|
-
|
195
|
+
unless tmp_body.key? 'Message'
|
196
|
+
self.logger.info('[transport-snssqs] msg body without SNS Message received')
|
197
|
+
next
|
198
|
+
end
|
194
199
|
# replacing the body with the SNS message (as it would be in a raw delivered SNS-SQS message)
|
195
200
|
msg.body = tmp_body['Message']
|
196
201
|
msg.message_attributes = {}
|
197
202
|
# discarding messages without attributes, since this would lead to an exception in subscribe
|
198
|
-
|
203
|
+
unless tmp_body.key? 'MessageAttributes'
|
204
|
+
self.logger.info('[transport-snssqs] msg body without message attributes received')
|
205
|
+
next
|
206
|
+
end
|
199
207
|
# parsing the message_attributes
|
200
208
|
tmp_body['MessageAttributes'].each do |name, value|
|
201
209
|
msg.message_attributes[name] = Aws::SQS::Types::MessageAttributeValue.new
|
@@ -203,6 +211,7 @@ module Sensu
|
|
203
211
|
msg.message_attributes[name].data_type = 'String'
|
204
212
|
end
|
205
213
|
end
|
214
|
+
self.logger.debug('[transport-snssqs] msg parsed successfully')
|
206
215
|
msg
|
207
216
|
rescue ::JSON::JSONError => e
|
208
217
|
self.logger.info(e)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-transport-snssqs-ng
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Troy Ready
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
SDfvq2xI1v+iTmBkyYqft23MKnTcc5jJ5Gh0a11a2zUstWaH1XHelXYCx44ZLCtC
|
32
32
|
Q6k=
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2017-
|
34
|
+
date: 2017-06-07 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: aws-sdk
|
metadata.gz.sig
CHANGED
Binary file
|