pheme 3.3.3 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/pheme/topic_publisher.rb +3 -2
- data/lib/pheme/version.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- data/spec/topic_publisher_spec.rb +5 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04243d79c91d1f19e0e2e2e9d04290a3a9dafa5acd907eec7e2dc0d80c99e21c
|
4
|
+
data.tar.gz: 9229a8eb9e453971f4b780954b7be9e770e784ffc6a129fbf331c232e9471247
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf5242abbfcc3b4ae522cbc0479c597d59a69835c33a1de2afe5e0a0eb70ef2afec4d73765367bb28c9c765ed702137f1d35117c5837e4eb3858a036ce5d6b5f
|
7
|
+
data.tar.gz: 773072b1e6c9ab9ae6437ae5ff61effca1ac3a3a389c933df8970acc35dc7bae26af6af9e030d5ab371080f12c4d140ad5ce1e161d4bd98d6e71015449dc3781
|
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
|
+
## 3.4.0 - 2020-03-17
|
8
|
+
### Added
|
9
|
+
- Add the ability to pass message attributes to SNS
|
10
|
+
|
7
11
|
## 3.3.0 - 2019-07-09
|
8
12
|
### Added
|
9
13
|
- Add more friendly options for initializing queue pollers by either:
|
@@ -34,7 +34,7 @@ module Pheme
|
|
34
34
|
raise NotImplementedError
|
35
35
|
end
|
36
36
|
|
37
|
-
def publish(message, sns_client: Pheme.configuration.sns_client)
|
37
|
+
def publish(message, sns_client: Pheme.configuration.sns_client, message_attributes: nil)
|
38
38
|
payload = {
|
39
39
|
message: "#{self.class} publishing message to #{topic_arn}",
|
40
40
|
body: message,
|
@@ -42,7 +42,8 @@ module Pheme
|
|
42
42
|
topic_arn: topic_arn,
|
43
43
|
}
|
44
44
|
Pheme.logger.info(payload.to_json)
|
45
|
-
|
45
|
+
|
46
|
+
sns_client.publish(topic_arn: topic_arn, message: serialize(message), message_attributes: message_attributes)
|
46
47
|
end
|
47
48
|
|
48
49
|
def serialize(message)
|
data/lib/pheme/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -36,10 +36,12 @@ describe Pheme::TopicPublisher do
|
|
36
36
|
expect(Pheme.configuration.sns_client).to receive(:publish).with({
|
37
37
|
topic_arn: "arn:aws:sns:whatever",
|
38
38
|
message: { id: "id-0", status: "complete" }.to_json,
|
39
|
+
message_attributes: nil,
|
39
40
|
})
|
40
41
|
expect(Pheme.configuration.sns_client).to receive(:publish).with({
|
41
42
|
topic_arn: "arn:aws:sns:whatever",
|
42
43
|
message: { id: "id-1", status: "complete" }.to_json,
|
44
|
+
message_attributes: nil,
|
43
45
|
})
|
44
46
|
subject.publish_events
|
45
47
|
end
|
@@ -54,6 +56,7 @@ describe Pheme::TopicPublisher do
|
|
54
56
|
expect(Pheme.configuration.sns_client).to receive(:publish).with({
|
55
57
|
topic_arn: topic_arn,
|
56
58
|
message: message,
|
59
|
+
message_attributes: nil,
|
57
60
|
})
|
58
61
|
subject.publish(message)
|
59
62
|
end
|
@@ -65,6 +68,7 @@ describe Pheme::TopicPublisher do
|
|
65
68
|
expect(sns_client).to receive(:publish).with({
|
66
69
|
topic_arn: topic_arn,
|
67
70
|
message: message,
|
71
|
+
message_attributes: nil,
|
68
72
|
})
|
69
73
|
subject.publish(message, sns_client: sns_client)
|
70
74
|
end
|
@@ -89,6 +93,7 @@ describe Pheme::TopicPublisher do
|
|
89
93
|
with({
|
90
94
|
topic_arn: topic_arn,
|
91
95
|
message: compressed_message,
|
96
|
+
message_attributes: nil,
|
92
97
|
}),
|
93
98
|
)
|
94
99
|
|
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: 3.
|
4
|
+
version: 3.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Graham
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -288,7 +288,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
288
288
|
- !ruby/object:Gem::Version
|
289
289
|
version: '0'
|
290
290
|
requirements: []
|
291
|
-
|
291
|
+
rubyforge_project:
|
292
|
+
rubygems_version: 2.7.6
|
292
293
|
signing_key:
|
293
294
|
specification_version: 4
|
294
295
|
summary: Ruby SNS publisher + SQS poller & message handler
|