eventq 2.3.0 → 2.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/lib/eventq/eventq_aws/aws_subscription_manager.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c8a55998f78ac404d51a4278b44b802a23d1b9c322cad2a29b8c1e94950ad4fa
|
|
4
|
+
data.tar.gz: 92dddbaed323bf8f803a07adc483376a2b255c43ce015c6a5ed59c3b81081478
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 45465979d1c58fd6cb0a4f54752a7cb4278c002465cbb12e3f4ee8b6e98538d9f65ab35e15d69cb41ae88d28f00fbc275bb73b7bc45be777e3c576d07384143f
|
|
7
|
+
data.tar.gz: 7011679b0e5c08fc6a0468067816e6bf136ce24900e411d5e1b1afedd53180c92c454dc9696874a2fad3f0a4d30dcd9a829a55fe4e9fb557b519f33abfec33c8
|
|
@@ -28,6 +28,10 @@ module EventQ
|
|
|
28
28
|
attributes = default_queue_attributes(q, queue_arn)
|
|
29
29
|
@client.sqs(queue_region).set_queue_attributes(attributes)
|
|
30
30
|
|
|
31
|
+
# skip subscribe if subscription for given queue/topic already exists
|
|
32
|
+
# this fixes a localstack issue: https://github.com/localstack/localstack/issues/933
|
|
33
|
+
return true if existing_subscription?(queue_arn, topic_arn)
|
|
34
|
+
|
|
31
35
|
@client.sns(topic_region).subscribe(
|
|
32
36
|
topic_arn: topic_arn,
|
|
33
37
|
protocol: 'sqs',
|
|
@@ -72,6 +76,12 @@ module EventQ
|
|
|
72
76
|
]
|
|
73
77
|
}'
|
|
74
78
|
end
|
|
79
|
+
|
|
80
|
+
# check if there is an existing subscription for the given queue/topic
|
|
81
|
+
def existing_subscription?(queue_arn, topic_arn)
|
|
82
|
+
subscriptions = @client.sns.list_subscriptions.subscriptions
|
|
83
|
+
subscriptions.any? { |subscription| subscription.topic_arn == topic_arn && subscription.endpoint == queue_arn }
|
|
84
|
+
end
|
|
75
85
|
end
|
|
76
86
|
end
|
|
77
87
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: eventq
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- SageOne
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-
|
|
11
|
+
date: 2019-08-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|