mimi-messaging-sqs_sns 0.4.0 → 0.4.1
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/mimi/messaging/sqs_sns/adapter.rb +20 -0
- data/lib/mimi/messaging/sqs_sns/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0919e38a4926e465f4b2017b98ce6b621a41f5b
|
4
|
+
data.tar.gz: f356e4552744757c4e6c77eb3eca359839d7d834
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b45642dc502c2bf8e5debf230460594abef63fde87f4f029d5583fdb942965465581be65e0eb050781d2780453f1843644a9c0539849ef1e562062b3370cd47b
|
7
|
+
data.tar.gz: b5251902e1ac67cad8731f05fdd5a0fe1a7e32db70f4aa62a9f7a29bdb0a2de0c6ff56e82c0fa5b01fabb9d7438fb0411aa62390daf1afe0ceed1ce72c223562
|
@@ -78,6 +78,7 @@ module Mimi
|
|
78
78
|
def start
|
79
79
|
@sqs_client = Aws::SQS::Client.new(sqs_client_config)
|
80
80
|
@sns_client = Aws::SNS::Client.new(sns_client_config)
|
81
|
+
check_availability!
|
81
82
|
end
|
82
83
|
|
83
84
|
def stop
|
@@ -248,6 +249,23 @@ module Mimi
|
|
248
249
|
params.compact
|
249
250
|
end
|
250
251
|
|
252
|
+
# Checks SQS and SNS clients availability
|
253
|
+
#
|
254
|
+
# @raise [Mimi::Messaging::ConnectionError]
|
255
|
+
#
|
256
|
+
def check_availability!
|
257
|
+
begin
|
258
|
+
queue_registry("test")
|
259
|
+
rescue StandardError => e
|
260
|
+
raise Mimi::Messaging::ConnectionError, "SQS connection is not available: #{e}"
|
261
|
+
end
|
262
|
+
begin
|
263
|
+
topic_registry("test")
|
264
|
+
rescue StandardError => e
|
265
|
+
raise Mimi::Messaging::ConnectionError, "SNS connection is not available: #{e}"
|
266
|
+
end
|
267
|
+
end
|
268
|
+
|
251
269
|
# Creates a new queue
|
252
270
|
#
|
253
271
|
# @param queue_name [String] name of the topic to be created
|
@@ -300,6 +318,8 @@ module Mimi
|
|
300
318
|
end
|
301
319
|
rescue Aws::SQS::Errors::NonExistentQueue
|
302
320
|
nil
|
321
|
+
rescue StandardError => e
|
322
|
+
raise Mimi::Messaging::ConnectionError, "Failed to get queue url '#{queue_name}': #{e}"
|
303
323
|
end
|
304
324
|
|
305
325
|
# Converts a topic or queue name to a fully qualified (with namespace)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mimi-messaging-sqs_sns
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Kukushkin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mimi-messaging
|