eventboss 1.5.0 → 1.7.0

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: 7d59c3796789baa9e13a8a2079b026909b2d37f426edeeed8936b83a1dfe97df
4
- data.tar.gz: 2af186a964a87844ec33a5a625c21b847fe1c7782583bf760c30aa6037de592c
3
+ metadata.gz: 8b837d9db4a587bec35fc7d31765551263011c2bd33559944c7de34ffa885c3b
4
+ data.tar.gz: 3b0f1808873bf4a8d2b5407b82de0ced2f86a2bd5f67775f4f3c73493dfe1bd7
5
5
  SHA512:
6
- metadata.gz: 8ff2e6aeaeb07d80a8e27a7609071a557ee2db659afa109035bbc7495f143e9bf9e504a48ac0358326583bab6ec1f670c241a2b35649c90b7adc2497396f7533
7
- data.tar.gz: 514290d9f45c66124c433a33dd4f169719bec4d1a6141e1fe734c228e4363068199ab48962820cedbaff9299d30abeda497b3f31270ce4669bb2958b39e312b2
6
+ metadata.gz: d7c7a8696654ccefd5d25596a9f439c8fbbd8ca41a71525f195010fbb0f469db5f6937632e0b6c46a67cb774b67fc3aeec174e507e649f46c2ab76e55ea56dee
7
+ data.tar.gz: 4d7c2b81fc401f5d7890ad1144ee87cd933a34470110a50b7d94e6d88fbcf5792f938777f7b93b3ec37280dc09d5b7c17f2e2b9ac9dc34f50f0c8ed4075af8ed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- eventboss (1.5.0)
4
+ eventboss (1.7.0)
5
5
  aws-sdk-sns (>= 1.1.0)
6
6
  aws-sdk-sqs (>= 1.3.0)
7
7
  dotenv (~> 2.1, >= 2.1.1)
@@ -9,20 +9,20 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- aws-eventstream (1.1.0)
13
- aws-partitions (1.374.0)
14
- aws-sdk-core (3.107.0)
12
+ aws-eventstream (1.1.1)
13
+ aws-partitions (1.432.0)
14
+ aws-sdk-core (3.113.0)
15
15
  aws-eventstream (~> 1, >= 1.0.2)
16
16
  aws-partitions (~> 1, >= 1.239.0)
17
17
  aws-sigv4 (~> 1.1)
18
18
  jmespath (~> 1.0)
19
- aws-sdk-sns (1.28.0)
20
- aws-sdk-core (~> 3, >= 3.99.0)
19
+ aws-sdk-sns (1.37.0)
20
+ aws-sdk-core (~> 3, >= 3.109.0)
21
21
  aws-sigv4 (~> 1.1)
22
- aws-sdk-sqs (1.33.0)
23
- aws-sdk-core (~> 3, >= 3.99.0)
22
+ aws-sdk-sqs (1.35.0)
23
+ aws-sdk-core (~> 3, >= 3.109.0)
24
24
  aws-sigv4 (~> 1.1)
25
- aws-sigv4 (1.2.2)
25
+ aws-sigv4 (1.2.3)
26
26
  aws-eventstream (~> 1, >= 1.0.2)
27
27
  diff-lcs (1.3)
28
28
  dotenv (2.7.6)
@@ -52,4 +52,4 @@ DEPENDENCIES
52
52
  rspec (~> 3.0)
53
53
 
54
54
  BUNDLED WITH
55
- 1.17.3
55
+ 2.1.4
@@ -25,14 +25,13 @@ module Eventboss
25
25
  :sns_sqs_name_infix,
26
26
  :listeners
27
27
 
28
-
29
28
  def raise_on_missing_configuration
30
29
  defined_or_default('raise_on_missing_configuration') { (ENV['EVENTBOSS_RAISE_ON_MISSING_CONFIGURATION'] || ENV['EVENTBUS_RAISE_ON_MISSING_CONFIGURATION'])&.downcase == 'true' }
31
30
  end
32
31
 
33
32
  def error_handlers
34
33
  defined_or_default('error_handlers') do
35
- [ErrorHandlers::Logger.new].tap do |handlers|
34
+ [ErrorHandlers::Logger.new, ErrorHandlers::NonExistentQueueHandler.new].tap do |handlers|
36
35
  handlers << ErrorHandlers::DbConnectionDropHandler.new if defined?(::ActiveRecord::StatementInvalid)
37
36
  handlers << ErrorHandlers::DbConnectionNotEstablishedHandler.new if defined?(::ActiveRecord::ConnectionNotEstablished)
38
37
  end
@@ -0,0 +1,12 @@
1
+ module Eventboss
2
+ module ErrorHandlers
3
+ class NonExistentQueueHandler
4
+ def call(exception, context = {})
5
+ if exception.class == ::Aws::SQS::Errors::NonExistentQueue
6
+ queue = context.fetch(:poller_id, "").sub('poller-', '')
7
+ Eventboss.logger.error("Queue doesn't exist: " + queue)
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -3,3 +3,4 @@ require 'eventboss/error_handlers/airbrake'
3
3
  require 'eventboss/error_handlers/rollbar'
4
4
  require 'eventboss/error_handlers/db_connection_drop_handler'
5
5
  require 'eventboss/error_handlers/db_connection_not_established_handler'
6
+ require 'eventboss/error_handlers/non_existent_queue_handler'
@@ -34,6 +34,7 @@ module Eventboss
34
34
  @bus.clear
35
35
  @pollers.each(&:terminate)
36
36
  @workers.each(&:terminate)
37
+ @bus.close
37
38
 
38
39
  wait_for_shutdown
39
40
  hard_shutdown
@@ -70,7 +71,7 @@ module Eventboss
70
71
  end
71
72
 
72
73
  def new_worker(id)
73
- Worker.new(self, id, @bus)
74
+ Worker.new(self, "worker-#{id}", @bus)
74
75
  end
75
76
 
76
77
  def new_poller(queue, listener)
@@ -45,6 +45,8 @@ module Eventboss
45
45
  fetch_messages.each do |message|
46
46
  logger.debug(id) { "enqueueing message #{message.message_id}" }
47
47
  @bus << UnitOfWork.new(@client, queue, listener, message)
48
+ rescue ClosedQueueError
49
+ logger.info(id) { "skip message #{message.message_id} enqueuing due to closed queue" }
48
50
  end
49
51
  end
50
52
 
@@ -53,6 +55,9 @@ module Eventboss
53
55
  @launcher.poller_stopped(self)
54
56
  rescue Eventboss::Shutdown
55
57
  @launcher.poller_stopped(self)
58
+ rescue Aws::SQS::Errors::NonExistentQueue
59
+ handle_exception(exception, poller_id: id)
60
+ @launcher.poller_stopped(self)
56
61
  rescue StandardError => exception
57
62
  handle_exception(exception, poller_id: id)
58
63
  # Give a chance for temporary AWS errors to be resolved
@@ -1,3 +1,3 @@
1
1
  module Eventboss
2
- VERSION = "1.5.0"
2
+ VERSION = "1.7.0"
3
3
  end
@@ -7,7 +7,7 @@ module Eventboss
7
7
  attr_reader :id
8
8
 
9
9
  def initialize(launcher, id, bus, restart_on: [Exception])
10
- @id = "worker-#{id}"
10
+ @id = id
11
11
  @launcher = launcher
12
12
  @bus = bus
13
13
  @thread = nil
@@ -45,7 +45,6 @@ module Eventboss
45
45
  end
46
46
 
47
47
  def kill(wait = false)
48
- stop_token
49
48
  return unless @thread
50
49
  @thread.raise Eventboss::Shutdown
51
50
  @thread.value if wait
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eventboss
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - AirHelp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-28 00:00:00.000000000 Z
11
+ date: 2021-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-sqs
@@ -128,6 +128,7 @@ files:
128
128
  - lib/eventboss/error_handlers/db_connection_drop_handler.rb
129
129
  - lib/eventboss/error_handlers/db_connection_not_established_handler.rb
130
130
  - lib/eventboss/error_handlers/logger.rb
131
+ - lib/eventboss/error_handlers/non_existent_queue_handler.rb
131
132
  - lib/eventboss/error_handlers/rollbar.rb
132
133
  - lib/eventboss/extensions.rb
133
134
  - lib/eventboss/fetcher.rb
@@ -172,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
172
173
  - !ruby/object:Gem::Version
173
174
  version: '0'
174
175
  requirements: []
175
- rubygems_version: 3.1.4
176
+ rubygems_version: 3.1.6
176
177
  signing_key:
177
178
  specification_version: 4
178
179
  summary: Eventboss Ruby Client.