arthropod 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/lib/arthropod/client.rb +3 -1
- data/lib/arthropod/request.rb +12 -2
- data/lib/arthropod/version.rb +1 -1
- 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: 7e5977affcffa6120138de964a27beca4dd7320945828640a649c80ee2e7a0e9
|
4
|
+
data.tar.gz: 2e7ce8610883f88b4968e31802646b7c38bbc5ccdec066096c9434c96dd5f4ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fed20998b883502cb07aa3a2f50bc0ebc4d33f1b5ee4628045b22271a7abfdd80455aafe4c6562d5c5893ba5c293a9de16f69bb7788db1afa42183306bfb19b
|
7
|
+
data.tar.gz: db0c27ed9ee4e09fbf4d60ca784342a4fe8db97fac3a89a74f73358e0ac59e9359b330b2cf02dec04bc5575c93cfc18f711801ab509c84a7a2df332a6e471e31
|
data/Gemfile.lock
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
arthropod (0.0.
|
4
|
+
arthropod (0.0.6)
|
5
5
|
aws-sdk-sqs
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
10
|
aws-eventstream (1.0.3)
|
11
|
-
aws-partitions (1.
|
12
|
-
aws-sdk-core (3.
|
11
|
+
aws-partitions (1.263.0)
|
12
|
+
aws-sdk-core (3.88.0)
|
13
13
|
aws-eventstream (~> 1.0, >= 1.0.2)
|
14
14
|
aws-partitions (~> 1, >= 1.239.0)
|
15
15
|
aws-sigv4 (~> 1.1)
|
data/lib/arthropod/client.rb
CHANGED
@@ -9,7 +9,9 @@ module Arthropod
|
|
9
9
|
client ||= Aws::SQS::Client.new
|
10
10
|
|
11
11
|
sender_queue = client.create_queue(queue_name: queue_name)
|
12
|
-
return_queue = client.create_queue(queue_name: SecureRandom.
|
12
|
+
return_queue = client.create_queue(queue_name: "#{SecureRandom.hex(32)}.fifo", attributes: {
|
13
|
+
'FifoQueue' => "true",
|
14
|
+
})
|
13
15
|
|
14
16
|
# Send our order with a return queue so we can get responses
|
15
17
|
client.send_message(queue_url: sender_queue.queue_url, message_body: JSON.dump({ return_queue_url: return_queue.queue_url, body: body }))
|
data/lib/arthropod/request.rb
CHANGED
@@ -1,10 +1,14 @@
|
|
1
|
+
require 'digest'
|
2
|
+
|
1
3
|
module Arthropod
|
2
4
|
class Request
|
3
|
-
attr_reader :message, :client
|
5
|
+
attr_reader :message, :client, :message_group_id
|
4
6
|
|
5
7
|
def initialize(client:, message:)
|
6
8
|
@client = client
|
7
9
|
@message = message
|
10
|
+
@message_group_id = Digest::SHA1.hexdigest(return_queue_url)
|
11
|
+
@sequence = 0
|
8
12
|
end
|
9
13
|
|
10
14
|
def body
|
@@ -36,10 +40,16 @@ module Arthropod
|
|
36
40
|
def send_message(message_body)
|
37
41
|
client.send_message({
|
38
42
|
queue_url: return_queue_url,
|
39
|
-
message_body: JSON.dump(message_body)
|
43
|
+
message_body: JSON.dump(message_body),
|
44
|
+
message_group_id: message_group_id,
|
45
|
+
message_deduplication_id: message_deduplication_id
|
40
46
|
})
|
41
47
|
end
|
42
48
|
|
49
|
+
def message_deduplication_id
|
50
|
+
"sequence:#{@sequence += 1}"
|
51
|
+
end
|
52
|
+
|
43
53
|
def parsed_message_body
|
44
54
|
@parsed_message_body ||= JSON.parse(message.body)
|
45
55
|
end
|
data/lib/arthropod/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arthropod
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Goya
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-01-
|
11
|
+
date: 2020-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-sqs
|