fastly_nsq 1.15.0 → 1.17.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/.git-blame-ignore-revs +6 -0
  3. data/.ruby-version +1 -1
  4. data/.travis.yml +4 -3
  5. data/ChangeLog.md +24 -1
  6. data/Gemfile +8 -8
  7. data/README.md +5 -1
  8. data/Rakefile +10 -11
  9. data/fastly_nsq.gemspec +26 -26
  10. data/lib/fastly_nsq/cli.rb +43 -50
  11. data/lib/fastly_nsq/consumer.rb +6 -6
  12. data/lib/fastly_nsq/feeder.rb +5 -7
  13. data/lib/fastly_nsq/http/nsqd.rb +28 -28
  14. data/lib/fastly_nsq/http/nsqlookupd.rb +11 -11
  15. data/lib/fastly_nsq/http.rb +4 -4
  16. data/lib/fastly_nsq/launcher.rb +16 -16
  17. data/lib/fastly_nsq/listener.rb +17 -16
  18. data/lib/fastly_nsq/manager.rb +13 -12
  19. data/lib/fastly_nsq/message.rb +9 -5
  20. data/lib/fastly_nsq/messenger.rb +25 -15
  21. data/lib/fastly_nsq/new_relic.rb +8 -8
  22. data/lib/fastly_nsq/priority_queue.rb +2 -2
  23. data/lib/fastly_nsq/priority_thread_pool.rb +3 -3
  24. data/lib/fastly_nsq/producer.rb +7 -7
  25. data/lib/fastly_nsq/safe_thread.rb +1 -1
  26. data/lib/fastly_nsq/testing.rb +12 -2
  27. data/lib/fastly_nsq/tls_options.rb +6 -6
  28. data/lib/fastly_nsq/version.rb +1 -1
  29. data/lib/fastly_nsq.rb +27 -29
  30. data/spec/cli_spec.rb +2 -2
  31. data/spec/consumer_spec.rb +12 -12
  32. data/spec/fastly_nsq_spec.rb +31 -31
  33. data/spec/feeder_spec.rb +4 -4
  34. data/spec/http/nsqd_spec.rb +23 -23
  35. data/spec/http/nsqlookupd_spec.rb +19 -19
  36. data/spec/http_spec.rb +22 -22
  37. data/spec/integration_spec.rb +10 -10
  38. data/spec/launcher_spec.rb +21 -21
  39. data/spec/listener_spec.rb +50 -50
  40. data/spec/manager_spec.rb +27 -27
  41. data/spec/matchers/delegate.rb +4 -4
  42. data/spec/message_spec.rb +20 -20
  43. data/spec/messenger_spec.rb +71 -59
  44. data/spec/new_relic.rb +27 -27
  45. data/spec/priority_thread_pool_spec.rb +2 -2
  46. data/spec/producer_spec.rb +30 -30
  47. data/spec/spec_helper.rb +12 -12
  48. data/spec/support/http.rb +2 -2
  49. data/spec/support/webmock.rb +1 -1
  50. data/spec/testing_spec.rb +12 -12
  51. data/spec/tls_options_spec.rb +47 -47
  52. metadata +14 -15
  53. data/.rubocop.yml +0 -68
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 135337a9892fdb4e0ddb5d448cae0f9d298b66a3a1a2d53966b9ba1c3c31d734
4
- data.tar.gz: 103ab244297b6e29b0f50fdda88881cbe030943b2d019dcf31f9080203b8d36b
3
+ metadata.gz: 6973f2a953a18f9f5b63d6e7225c94264f56485b4632a409c820b5b61f91b050
4
+ data.tar.gz: 1a8f39f1085191666a6ebccff53a8c6f691fad4770bea6a48affc8f7998a878b
5
5
  SHA512:
6
- metadata.gz: 948bd9896a2709c88b2dffdfc8fa13de42d8f0d46f62c8cd635ff4323dd57a2be75cb805598a6878059a7416aa5e78f719cd4d026462833fe609168a46e8ebd9
7
- data.tar.gz: 299eb6013dc14fd5f7fc84e752d75b60c633883e60517b9f507e7247bca4d6bb0a2ca4825cffc8b3836697208e76cac464a83ec25bda5119b852c724b25b82bc
6
+ metadata.gz: da7997c5cdc6b8cb7d5feeacb0feab24c062076c92b8a3b23ddb49416d5a1fe57d0c241a68b20b5aed15c3a2c6cad89015557268dd2827fa49a7c63236de6300
7
+ data.tar.gz: 007a732d613f15d099e28f301db5537d35cfe7675d45f46946526eb275b5196496520a1b2f0aaf3c011414b0b55eafa19218f5f71cf6a9fb42ea59678fc11b1b
@@ -0,0 +1,6 @@
1
+ 25bc1d8cd908a86e8f7536192541a0d3b66f07db
2
+ 7c4cf244c4586d3bd280fee7909b6bcabda34998
3
+ 2e09ec7d8205b3ed3c2093777ae5382723919787
4
+ 5381db0ed1493235a7095a51cdbd67b88caa47d2
5
+ d77aee840f7affb6ccdeb3748e0c50ccea96f7ef
6
+ ca9a1aa122ead418879ecb6a104fb61054fe675e
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.5.1
1
+ 3.0.3
data/.travis.yml CHANGED
@@ -2,14 +2,15 @@ language: ruby
2
2
  cache: bundler
3
3
  sudo: false
4
4
  rvm:
5
- - 2.3.5
6
- - 2.4.2
7
- - 2.5.1
5
+ - 2.6.9
6
+ - 2.7.5
7
+ - 3.0.3
8
8
  script:
9
9
  - bundle exec rake
10
10
  services:
11
11
  - docker
12
12
  before_install:
13
+ - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
13
14
  - docker-compose up -d
14
15
  before_script:
15
16
  - gem update --system
data/ChangeLog.md CHANGED
@@ -1,7 +1,30 @@
1
1
  # Change Log
2
2
 
3
- ## [v1.15.0](https://github.com/fastly/fastly_nsq/tree/v1.15.0)
3
+ ## [v1.17.1](https://github.com/fastly/fastly_nsq/tree/v1.17.1) (2022-02-23)
4
+ [Full Changelog](https://github.com/fastly/fastly_nsq/compare/v1.17.0...v1.17.1)
4
5
 
6
+ **Merged pull requests:**
7
+
8
+ - Use standardrb for style and formatting [\#104](https://github.com/fastly/fastly_nsq/pull/104)
9
+
10
+ ## [v1.17.0](https://github.com/fastly/fastly_nsq/tree/v1.17.0) (2021-02-11)
11
+ [Full Changelog](https://github.com/fastly/fastly_nsq/compare/v1.16.0...v1.17.0)
12
+
13
+ **Merged pull requests:**
14
+
15
+ - Support for arbitary sent\_at Time [\#99](https://github.com/fastly/fastly_nsq/pull/99) ([leklund](https://github.com/leklund))
16
+ - remove version pin on rake for development [\#97](https://github.com/fastly/fastly_nsq/pull/97) ([leklund](https://github.com/leklund))
17
+ - Ignore from Humane Registry [\#96](https://github.com/fastly/fastly_nsq/pull/96) ([leklund](https://github.com/leklund))
18
+
19
+ ## [v1.16.0](https://github.com/fastly/fastly_nsq/tree/v1.16.0) (2019-08-16)
20
+ [Full Changelog](https://github.com/fastly/fastly_nsq/compare/v1.15.0...v1.16.0)
21
+
22
+ **Merged pull requests:**
23
+
24
+ - Log the internal NSQ id [\#95](https://github.com/fastly/fastly_nsq/pull/95) ([leklund](https://github.com/leklund))
25
+ - Consumer still attempts connections in Test mode [\#93](https://github.com/fastly/fastly_nsq/pull/93) ([alieander](https://github.com/alieander))
26
+
27
+ ## [v1.15.0](https://github.com/fastly/fastly_nsq/tree/v1.15.0) (2018-10-05)
5
28
  [Full Changelog](https://github.com/fastly/fastly_nsq/compare/v1.14.0...v1.15.0)
6
29
 
7
30
  **Merged pull requests:**
data/Gemfile CHANGED
@@ -1,13 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- source 'https://rubygems.org'
3
+ source "https://rubygems.org"
4
4
 
5
5
  gemspec
6
6
 
7
- gem 'bundler-audit', '~> 0.5.0'
8
- gem 'newrelic_rpm', require: false
9
- gem 'overcommit', '~> 0.32.0'
10
- gem 'rake', '~> 11.1.2'
11
- gem 'rdoc', '~> 4.2.2'
12
- gem 'rubocop', '~> 0.51.0'
13
- gem 'rubygems-tasks', '~> 0.2'
7
+ gem "bundler-audit"
8
+ gem "newrelic_rpm", require: false
9
+ gem "overcommit", "~> 0.32.0"
10
+ gem "rake"
11
+ gem "rdoc"
12
+ gem "standard"
13
+ gem "rubygems-tasks", "~> 0.2"
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # fastly_nsq [![Build Status](https://travis-ci.org/fastly/fastly_nsq.svg?branch=master)](https://travis-ci.org/fastly/fastly_nsq)
1
+ # fastly_nsq [![Build Status](https://travis-ci.org/fastly/fastly_nsq.svg?branch=main)](https://travis-ci.org/fastly/fastly_nsq)
2
2
 
3
3
  NSQ adapter and testing objects
4
4
  for using the NSQ messaging system
@@ -334,3 +334,7 @@ You will still need the `ENV` variables as defined above.
334
334
  Copyright (c) 2016 [Fastly, Inc](https://fastly.com) under an MIT license.
335
335
 
336
336
  See [LICENSE.txt](LICENSE.txt) for details.
337
+
338
+ # Metadata
339
+
340
+ - Ignore
data/Rakefile CHANGED
@@ -1,28 +1,28 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'rubygems'
3
+ require "rubygems"
4
4
 
5
5
  begin
6
- require 'bundler/setup'
6
+ require "bundler/setup"
7
7
  rescue LoadError => e
8
8
  abort e.message
9
9
  end
10
10
 
11
- require 'rake'
11
+ require "rake"
12
12
 
13
- require 'rubygems/tasks'
13
+ require "rubygems/tasks"
14
14
  Gem::Tasks.new
15
15
 
16
- require 'rdoc/task'
16
+ require "rdoc/task"
17
17
  RDoc::Task.new
18
18
  task doc: :rdoc
19
19
 
20
- require 'rspec/core/rake_task'
20
+ require "rspec/core/rake_task"
21
21
  RSpec::Core::RakeTask.new(:spec)
22
22
 
23
- require 'bundler/audit/cli'
23
+ require "bundler/audit/cli"
24
24
  namespace :bundler do
25
- desc 'Updates the ruby-advisory-db and runs audit'
25
+ desc "Updates the ruby-advisory-db and runs audit"
26
26
  task :audit do
27
27
  %w[update check].each do |command|
28
28
  Bundler::Audit::CLI.start [command]
@@ -30,8 +30,7 @@ namespace :bundler do
30
30
  end
31
31
  end
32
32
 
33
- require 'rubocop/rake_task'
34
- RuboCop::RakeTask.new
33
+ require "standard/rake"
35
34
 
36
35
  task(:default).clear
37
- task default: ['spec', 'rubocop', 'bundler:audit']
36
+ task default: ["spec", "standard", "bundler:audit"]
data/fastly_nsq.gemspec CHANGED
@@ -1,36 +1,36 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- lib = File.expand_path('../lib', __FILE__)
3
+ lib = File.expand_path("../lib", __FILE__)
4
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require 'fastly_nsq/version'
5
+ require "fastly_nsq/version"
6
6
 
7
7
  Gem::Specification.new do |gem|
8
- gem.name = 'fastly_nsq'
9
- gem.version = FastlyNsq::VERSION
10
- gem.summary = 'Fastly NSQ Adapter'
11
- gem.description = "Helper classes for Fastly's NSQ Services"
12
- gem.license = 'MIT'
13
- gem.authors = ["Tommy O'Neil", 'Adarsh Pandit', 'Joshua Wehner', 'Lukas Eklund', 'Josh Lane', 'Hassan Shahid']
14
- gem.email = 'tommy@fastly.com'
15
- gem.homepage = 'https://github.com/fastly/fastly_nsq'
8
+ gem.name = "fastly_nsq"
9
+ gem.version = FastlyNsq::VERSION
10
+ gem.summary = "Fastly NSQ Adapter"
11
+ gem.description = "Helper classes for Fastly's NSQ Services"
12
+ gem.license = "MIT"
13
+ gem.authors = ["Tommy O'Neil", "Adarsh Pandit", "Joshua Wehner", "Lukas Eklund", "Josh Lane", "Hassan Shahid"]
14
+ gem.email = "tommy@fastly.com"
15
+ gem.homepage = "https://github.com/fastly/fastly_nsq"
16
16
 
17
- gem.files = `git ls-files`.split("\n")
17
+ gem.files = `git ls-files`.split("\n")
18
18
 
19
- gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
20
- gem.test_files = gem.files.grep(%r{^(test|features)/})
21
- gem.require_paths = ['lib']
19
+ gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
20
+ gem.test_files = gem.files.grep(%r{^(test|features)/})
21
+ gem.require_paths = ["lib"]
22
22
 
23
- gem.add_development_dependency 'awesome_print', '~> 1.6'
24
- gem.add_development_dependency 'bundler', '~> 1.12'
25
- gem.add_development_dependency 'dotenv'
26
- gem.add_development_dependency 'pry-byebug', '~> 3.3'
27
- gem.add_development_dependency 'rspec', '~> 3.4'
28
- gem.add_development_dependency 'rspec-eventually', '0.2'
29
- gem.add_development_dependency 'timecop'
30
- gem.add_development_dependency 'webmock', '~> 3.0'
31
- gem.add_development_dependency 'yard'
23
+ gem.add_development_dependency "awesome_print", "~> 1.6"
24
+ gem.add_development_dependency "bundler"
25
+ gem.add_development_dependency "dotenv"
26
+ gem.add_development_dependency "pry-byebug", "~> 3.3"
27
+ gem.add_development_dependency "rspec", "~> 3.4"
28
+ gem.add_development_dependency "rspec-eventually", "0.2"
29
+ gem.add_development_dependency "timecop"
30
+ gem.add_development_dependency "webmock", "~> 3.0"
31
+ gem.add_development_dependency "yard"
32
32
 
33
- gem.add_dependency 'concurrent-ruby', '~> 1.0'
34
- gem.add_dependency 'nsq-ruby', '~> 2.3'
35
- gem.add_dependency 'priority_queue_cxx', '~> 0.3'
33
+ gem.add_dependency "concurrent-ruby", "~> 1.0"
34
+ gem.add_dependency "nsq-ruby-fastly", "~> 2.4"
35
+ gem.add_dependency "priority_queue_cxx", "~> 0.3"
36
36
  end
@@ -1,14 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # rubocop:disable Metrics/ClassLength
4
3
  $stdout.sync = true
5
4
 
6
- require 'fastly_nsq'
7
- require 'fastly_nsq/launcher'
8
- require 'fastly_nsq/manager'
9
- require 'fileutils'
10
- require 'optparse'
11
- require 'singleton'
5
+ require "fastly_nsq"
6
+ require "fastly_nsq/launcher"
7
+ require "fastly_nsq/manager"
8
+ require "fileutils"
9
+ require "optparse"
10
+ require "singleton"
12
11
 
13
12
  # Provides functionality to support running FastlyNsq as a command line
14
13
  # application that listens and processes NSQ messages.
@@ -44,26 +43,24 @@ class FastlyNsq::CLI
44
43
 
45
44
  read_loop
46
45
  rescue Interrupt
47
- FastlyNsq.logger.info 'Shutting down'
46
+ FastlyNsq.logger.info "Shutting down"
48
47
  launcher.stop
49
48
  # Explicitly exit so busy Processor threads can't block
50
49
  # process shutdown.
51
- FastlyNsq.logger.info 'Bye!'
50
+ FastlyNsq.logger.info "Bye!"
52
51
  exit(0)
53
52
  end
54
53
 
55
54
  private
56
55
 
57
56
  def launcher
58
- @launcher ||= FastlyNsq::Launcher.new(options)
57
+ @launcher ||= FastlyNsq::Launcher.new(**options)
59
58
  end
60
59
 
61
60
  def read_loop
62
61
  trapped_read_io = trap_signals
63
- loop do
64
- readable_io = IO.select([trapped_read_io])
65
- break unless readable_io
66
- signal = readable_io.first[0].gets.strip
62
+ while trapped_read_io.wait_readable
63
+ signal = trapped_read_io.gets.strip
67
64
  handle_signal signal
68
65
  end
69
66
  end
@@ -72,51 +69,51 @@ class FastlyNsq::CLI
72
69
  boot_rails
73
70
  require options[:require] if options[:require]
74
71
  FastlyNsq.logger.info "Running in #{RUBY_DESCRIPTION}"
75
- FastlyNsq.logger.info 'Starting processing, hit Ctrl-C to stop' unless options[:daemon]
72
+ FastlyNsq.logger.info "Starting processing, hit Ctrl-C to stop" unless options[:daemon]
76
73
  end
77
74
 
78
75
  def boot_rails
79
- return unless ENV['RAILS_ENV']
76
+ return unless ENV["RAILS_ENV"]
80
77
 
81
- require 'rails'
82
- require File.expand_path('./config/application.rb')
83
- require File.expand_path('./config/environment.rb')
78
+ require "rails"
79
+ require File.expand_path("./config/application.rb")
80
+ require File.expand_path("./config/environment.rb")
84
81
  end
85
82
 
86
83
  def parse(args)
87
84
  opts = {}
88
85
 
89
86
  @parser = OptionParser.new do |o|
90
- o.on '-c', '--concurrency COUNT', 'Number of threads used to process messages' do |arg|
87
+ o.on "-c", "--concurrency COUNT", "Number of threads used to process messages" do |arg|
91
88
  opts[:max_threads] = arg
92
89
  end
93
90
 
94
- o.on '-d', '--daemon', 'Daemonize process' do |arg|
91
+ o.on "-d", "--daemon", "Daemonize process" do |arg|
95
92
  opts[:daemonize] = arg
96
93
  end
97
94
 
98
- o.on '-L', '--logfile PATH', 'path to writable logfile' do |arg|
95
+ o.on "-L", "--logfile PATH", "path to writable logfile" do |arg|
99
96
  opts[:logfile] = arg
100
97
  end
101
98
 
102
- o.on '-P', '--pidfile PATH', 'path to pidfile' do |arg|
99
+ o.on "-P", "--pidfile PATH", "path to pidfile" do |arg|
103
100
  opts[:pidfile] = arg
104
101
  end
105
102
 
106
- o.on '-r', '--require [PATH|DIR]', 'Location of message_processor definition' do |arg|
103
+ o.on "-r", "--require [PATH|DIR]", "Location of message_processor definition" do |arg|
107
104
  opts[:require] = arg
108
105
  end
109
106
 
110
- o.on '-v', '--verbose', 'enable verbose logging output' do |arg|
107
+ o.on "-v", "--verbose", "enable verbose logging output" do |arg|
111
108
  opts[:verbose] = arg
112
109
  end
113
110
 
114
- o.on '-t', '--timeout SECONDS', 'shutdown deadline timeout' do |arg|
111
+ o.on "-t", "--timeout SECONDS", "shutdown deadline timeout" do |arg|
115
112
  opts[:timeout] = arg
116
113
  end
117
114
  end
118
115
 
119
- @parser.banner = 'fastly_nsq [options]'
116
+ @parser.banner = "fastly_nsq [options]"
120
117
  @parser.parse!(args)
121
118
 
122
119
  @options = opts
@@ -171,13 +168,11 @@ class FastlyNsq::CLI
171
168
  sigs = %w[INT TERM TTIN USR1]
172
169
 
173
170
  sigs.each do |sig|
174
- begin
175
- trap sig do
176
- self_write.puts(sig)
177
- end
178
- rescue ArgumentError
179
- puts "Signal #{sig} not supported"
171
+ trap sig do
172
+ self_write.puts(sig)
180
173
  end
174
+ rescue ArgumentError
175
+ puts "Signal #{sig} not supported"
181
176
  end
182
177
  self_read
183
178
  end
@@ -185,28 +180,28 @@ class FastlyNsq::CLI
185
180
  def handle_signal(sig)
186
181
  FastlyNsq.logger.debug "Got #{sig} signal"
187
182
  case sig
188
- when 'INT'
183
+ when "INT"
189
184
  # Handle Ctrl-C in JRuby like MRI
190
185
  # http://jira.codehaus.org/browse/JRUBY-4637
191
186
  raise Interrupt
192
- when 'TERM'
187
+ when "TERM"
193
188
  # Heroku sends TERM and then waits 10 seconds for process to exit.
194
189
  raise Interrupt
195
- when 'USR1'
196
- FastlyNsq.logger.info 'Received USR1, no longer accepting new work'
190
+ when "USR1"
191
+ FastlyNsq.logger.info "Received USR1, no longer accepting new work"
197
192
  launcher.stop_listeners
198
- when 'TTIN'
193
+ when "TTIN"
199
194
  handle_ttin
200
195
  end
201
196
  end
202
197
 
203
198
  def handle_ttin
204
199
  Thread.list.each do |thread|
205
- FastlyNsq.logger.warn "Thread TID-#{thread.object_id.to_s(36)} #{thread['fastly_nsq_label']}"
200
+ FastlyNsq.logger.warn "Thread TID-#{thread.object_id.to_s(36)} #{thread["fastly_nsq_label"]}"
206
201
  if thread.backtrace
207
202
  FastlyNsq.logger.warn thread.backtrace.join("\n")
208
203
  else
209
- FastlyNsq.logger.warn '<no backtrace available>'
204
+ FastlyNsq.logger.warn "<no backtrace available>"
210
205
  end
211
206
  end
212
207
  end
@@ -224,26 +219,24 @@ class FastlyNsq::CLI
224
219
  reopen(files_to_reopen)
225
220
 
226
221
  [$stdout, $stderr].each do |io|
227
- File.open(options.fetch(:logfile, '/dev/null'), 'ab') do |f|
222
+ File.open(options.fetch(:logfile, "/dev/null"), "ab") do |f|
228
223
  io.reopen(f)
229
224
  end
230
225
  io.sync = true
231
226
  end
232
- $stdin.reopen('/dev/null')
227
+ $stdin.reopen("/dev/null")
233
228
 
234
229
  setup_logger
235
230
  end
236
231
 
237
232
  def reopen(files)
238
233
  files.each do |file|
239
- begin
240
- file.reopen file.path, 'a+'
241
- file.sync = true
242
- rescue IOError => e
243
- FastlyNsq.logger.warn "IOError reopening file: #{e.message}"
244
- rescue StandardError => e
245
- FastlyNsq.logger.error "Non IOError reopening file: #{e.message}"
246
- end
234
+ file.reopen file.path, "a+"
235
+ file.sync = true
236
+ rescue IOError => e
237
+ FastlyNsq.logger.warn "IOError reopening file: #{e.message}"
238
+ rescue => e
239
+ FastlyNsq.logger.error "Non IOError reopening file: #{e.message}"
247
240
  end
248
241
  end
249
242
 
@@ -78,11 +78,11 @@ class FastlyNsq::Consumer
78
78
  # channel: 'channel'
79
79
  # )
80
80
  def initialize(topic:, channel:, queue: nil, tls_options: nil, connect_timeout: DEFAULT_CONNECTION_TIMEOUT, max_attempts: FastlyNsq.max_attempts, **options)
81
- @topic = topic
82
- @channel = channel
83
- @tls_options = FastlyNsq::TlsOptions.as_hash(tls_options)
81
+ @topic = topic
82
+ @channel = channel
83
+ @tls_options = FastlyNsq::TlsOptions.as_hash(tls_options)
84
84
  @connect_timeout = connect_timeout
85
- @max_attempts = max_attempts
85
+ @max_attempts = max_attempts
86
86
 
87
87
  @connection = connect(queue, **options)
88
88
  end
@@ -106,8 +106,8 @@ class FastlyNsq::Consumer
106
106
  channel: channel,
107
107
  queue: queue,
108
108
  max_attempts: max_attempts,
109
- **options,
110
- }.merge(tls_options),
109
+ **options
110
+ }.merge(tls_options)
111
111
  )
112
112
  end
113
113
  end
@@ -36,13 +36,11 @@ class FastlyNsq::Feeder
36
36
  # @see Nsq::Connection#read_loop
37
37
  def push(message)
38
38
  FastlyNsq.manager.pool.post(priority) do
39
- begin
40
- processor.call(message)
41
- rescue => ex
42
- FastlyNsq.logger.error ex
43
- FastlyNsq.tracer.notice_error ex
44
- raise ex
45
- end
39
+ processor.call(message)
40
+ rescue => ex
41
+ FastlyNsq.logger.error ex
42
+ FastlyNsq.tracer.notice_error ex
43
+ raise ex
46
44
  end
47
45
  end
48
46
  end