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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 105894d0c418c93cd154889ac1ef0cfcffb5f584a7998e08e3eec4f076f37006
4
- data.tar.gz: a557f76e8283b0b54760d2a7cbd4aea97330c907c305e683842ee0941b98ca6a
3
+ metadata.gz: 7e5977affcffa6120138de964a27beca4dd7320945828640a649c80ee2e7a0e9
4
+ data.tar.gz: 2e7ce8610883f88b4968e31802646b7c38bbc5ccdec066096c9434c96dd5f4ee
5
5
  SHA512:
6
- metadata.gz: 047daca66c254f002a7338d09cb8a3dc5df1c81d2449dea6a2f4d88cca20733c6136609abe1df3787ca42a5e1743b0abcfb3376acb1fcf4dd47fc72fc71098b6
7
- data.tar.gz: e5fbcad4be26d817c8f8f3583412f3b72a2e5bb1c6ac4961026cfa01d19a91cf618d76c0aa8cffb91e634fbc0028b0f7212e75927e97beb8549676fb8efa65d3
6
+ metadata.gz: 6fed20998b883502cb07aa3a2f50bc0ebc4d33f1b5ee4628045b22271a7abfdd80455aafe4c6562d5c5893ba5c293a9de16f69bb7788db1afa42183306bfb19b
7
+ data.tar.gz: db0c27ed9ee4e09fbf4d60ca784342a4fe8db97fac3a89a74f73358e0ac59e9359b330b2cf02dec04bc5575c93cfc18f711801ab509c84a7a2df332a6e471e31
@@ -1,15 +1,15 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- arthropod (0.0.3)
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.254.0)
12
- aws-sdk-core (3.85.1)
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)
@@ -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.uuid.gsub("-", "_"))
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 }))
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Arthropod
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
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.6
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-10 00:00:00.000000000 Z
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