pheme 4.0.0 → 4.0.1
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/pheme/queue_poller.rb +8 -7
- data/lib/pheme/version.rb +1 -1
- data/spec/queue_poller_spec.rb +6 -7
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0657fbd0490ab265656d91778ee29ee63f48af6544bb15766602afa3c3ff178e
|
4
|
+
data.tar.gz: 0dc1b438ca602e23c522856e93af5563b7186d24f8d638ff20ffddd7d9866a51
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f77b6d79b12c32e1648510bfe44fb8455c06132d759c77b83d69e57e023bd531e99c858a03fbb0680e9e4923b274a07eef44914b5d99619911546df7fe09c95b
|
7
|
+
data.tar.gz: 75c1691f0b7b0d98e5024db118f663731edf9a08a7ba9528aaa9df3ce1626fdce7abfb0f111c1ecea599b2a1bda94a3553376711e5b1605a2d9a0a73e76e4b49
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## 4.0.1 - 2020-03-23
|
8
|
+
### Fixes
|
9
|
+
- Fixes 4.0.0. Instead of expecting message attributes in the message from `poll`, retrieves them from the right place.
|
10
|
+
|
7
11
|
## 4.0.0 - 2020-03-18
|
8
12
|
### Breaking Changes
|
9
13
|
- Add the ability for SQS to receive message attributes
|
data/lib/pheme/queue_poller.rb
CHANGED
@@ -110,8 +110,9 @@ module Pheme
|
|
110
110
|
end
|
111
111
|
|
112
112
|
def parse_message_attributes(queue_message)
|
113
|
+
message_body = JSON.parse(queue_message.body)
|
113
114
|
message_attributes = {}
|
114
|
-
|
115
|
+
message_body['MessageAttributes']&.each do |key, value|
|
115
116
|
message_attributes[key.to_sym] = coerce_message_attribute(value)
|
116
117
|
end
|
117
118
|
|
@@ -149,18 +150,18 @@ module Pheme
|
|
149
150
|
private
|
150
151
|
|
151
152
|
def coerce_message_attribute(value)
|
152
|
-
case value['
|
153
|
+
case value['Type']
|
153
154
|
when 'String'
|
154
|
-
value['
|
155
|
+
value['Value']
|
155
156
|
when 'Number'
|
156
|
-
JSON.parse(value['
|
157
|
+
JSON.parse(value['Value'])
|
157
158
|
when 'String.Array'
|
158
|
-
JSON.parse(value['
|
159
|
+
JSON.parse(value['Value'])
|
159
160
|
when 'Binary'
|
160
|
-
value['
|
161
|
+
value['Value']
|
161
162
|
else
|
162
163
|
Pheme.logger.info("Unsupported custom data type")
|
163
|
-
value["
|
164
|
+
value["Value"]
|
164
165
|
end
|
165
166
|
end
|
166
167
|
|
data/lib/pheme/version.rb
CHANGED
data/spec/queue_poller_spec.rb
CHANGED
@@ -146,14 +146,13 @@ describe Pheme::QueuePoller do
|
|
146
146
|
context 'when message attributes' do
|
147
147
|
let(:queue_message) do
|
148
148
|
OpenStruct.new(
|
149
|
-
body: {
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
"data_type" => data_type,
|
154
|
-
"string_value" => string_value,
|
149
|
+
body: {
|
150
|
+
Message: message,
|
151
|
+
MessageAttributes: {
|
152
|
+
key: { Type: data_type, Value: string_value },
|
155
153
|
},
|
156
|
-
},
|
154
|
+
}.to_json,
|
155
|
+
message_id: message_id,
|
157
156
|
)
|
158
157
|
end
|
159
158
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pheme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Graham
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -288,8 +288,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
288
288
|
- !ruby/object:Gem::Version
|
289
289
|
version: '0'
|
290
290
|
requirements: []
|
291
|
-
|
292
|
-
rubygems_version: 2.7.6
|
291
|
+
rubygems_version: 3.0.3
|
293
292
|
signing_key:
|
294
293
|
specification_version: 4
|
295
294
|
summary: Ruby SNS publisher + SQS poller & message handler
|