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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0711608ea3831e4718cb928b6e3db90bd049c302b5ae864c4e457f3797215add'
4
- data.tar.gz: 1387f1048aef3104ff08aad3fb5cdc7d3a542bfbb9b2c71e49f02b78fe67b8c3
3
+ metadata.gz: 0657fbd0490ab265656d91778ee29ee63f48af6544bb15766602afa3c3ff178e
4
+ data.tar.gz: 0dc1b438ca602e23c522856e93af5563b7186d24f8d638ff20ffddd7d9866a51
5
5
  SHA512:
6
- metadata.gz: f6ef008cf929f3eb8e6f9d846ee316982e378039f9a40b7900eb52bedd073fbfb80221d6de1dfb72d74b660f7faf75e0bad5d9f20148368d9332446704267dda
7
- data.tar.gz: be52cf4fe2479f239568488fd5c498642842bb92646496907598a211700a1ad994fd889fb9d99c8923f411c24c0d258224fddbb3eb88414207ee92aff7bf437e
6
+ metadata.gz: f77b6d79b12c32e1648510bfe44fb8455c06132d759c77b83d69e57e023bd531e99c858a03fbb0680e9e4923b274a07eef44914b5d99619911546df7fe09c95b
7
+ data.tar.gz: 75c1691f0b7b0d98e5024db118f663731edf9a08a7ba9528aaa9df3ce1626fdce7abfb0f111c1ecea599b2a1bda94a3553376711e5b1605a2d9a0a73e76e4b49
@@ -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
@@ -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
- queue_message.message_attributes&.each do |key, value|
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['data_type']
153
+ case value['Type']
153
154
  when 'String'
154
- value['string_value']
155
+ value['Value']
155
156
  when 'Number'
156
- JSON.parse(value['string_value'])
157
+ JSON.parse(value['Value'])
157
158
  when 'String.Array'
158
- JSON.parse(value['string_value'])
159
+ JSON.parse(value['Value'])
159
160
  when 'Binary'
160
- value['binary_value']
161
+ value['Value']
161
162
  else
162
163
  Pheme.logger.info("Unsupported custom data type")
163
- value["binary_value"] || value["string_value"]
164
+ value["Value"]
164
165
  end
165
166
  end
166
167
 
@@ -1,3 +1,3 @@
1
1
  module Pheme
2
- VERSION = '4.0.0'.freeze
2
+ VERSION = '4.0.1'.freeze
3
3
  end
@@ -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: { Message: message }.to_json,
150
- message_id: message_id,
151
- message_attributes: {
152
- "key" => {
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.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-20 00:00:00.000000000 Z
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
- rubyforge_project:
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