Skip to content

Commit 80d3f6e

Browse files
committed
add some fixes
1 parent fec517c commit 80d3f6e

File tree

6 files changed

+24
-12
lines changed

6 files changed

+24
-12
lines changed

Diff for: Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ gem "rspec-its"
1313
gem "rubocop-config-umbrellio"
1414
gem "simplecov"
1515
gem "simplecov-lcov"
16+
gem "sneakers_handlers", github: "umbrellio/sneakers_handlers", branch: "gt-1241-test-rabbit-dlx"

Diff for: Gemfile.lock

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
GIT
2+
remote: https://github.com/umbrellio/sneakers_handlers.git
3+
revision: 2fd531a99c85f042923ae8b8bd0f3b340af4d15f
4+
branch: gt-1241-test-rabbit-dlx
5+
specs:
6+
sneakers_handlers (0.1.0)
7+
kicks
8+
19
PATH
210
remote: .
311
specs:
@@ -6,7 +14,6 @@ PATH
614
kicks (~> 3)
715
lamian
816
rails (>= 6.1)
9-
sneakers_handlers
1017
tainbox
1118

1219
GEM
@@ -273,21 +280,13 @@ GEM
273280
simplecov-html (0.13.1)
274281
simplecov-lcov (0.8.0)
275282
simplecov_json_formatter (0.1.4)
276-
sneakers (0.0.7)
277-
bunny (>= 0.10.0)
278-
serverengine
279-
thor
280-
thread
281-
sneakers_handlers (0.0.6)
282-
sneakers
283283
sorted_set (1.0.3)
284284
rbtree
285285
set (~> 1.0)
286286
stringio (3.1.1)
287287
tainbox (2.1.2)
288288
activesupport
289289
thor (1.3.2)
290-
thread (0.2.2)
291290
timeout (0.4.1)
292291
tzinfo (2.0.6)
293292
concurrent-ruby (~> 1.0)
@@ -313,6 +312,7 @@ DEPENDENCIES
313312
rubocop-config-umbrellio
314313
simplecov
315314
simplecov-lcov
315+
sneakers_handlers!
316316

317317
BUNDLED WITH
318318
2.5.22

Diff for: lib/rabbit.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def app_name
6161
end
6262

6363
def read_queue
64-
[app_name, queue_suffix].compact.join(".")
64+
[app_name, queue_suffix].reject { |x| x.nil? || x.empty? }.join(".")
6565
end
6666
end
6767

Diff for: lib/rabbit/daemon.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def run(logger: Sneakers.logger)
2828

2929
Receiving::Worker.from_queue(
3030
Rabbit.config.read_queue,
31-
handler: SneakersHandlers::ExponentialBackoffHandler,
31+
handler: SneakersHandlers::ExponentialBackoffHandler, # TODO: add config
3232
max_retries: Rabbit.config.backoff_handler_max_retries,
3333
arguments: {
3434
"x-dead-letter-exchange" => "#{Rabbit.config.read_queue}.dlx",

Diff for: rabbit_messaging.gemspec

-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,5 @@ Gem::Specification.new do |spec|
2323
spec.add_dependency "kicks", "~> 3"
2424
spec.add_dependency "lamian"
2525
spec.add_dependency "rails", ">= 6.1"
26-
spec.add_dependency "sneakers_handlers"
2726
spec.add_dependency "tainbox"
2827
end

Diff for: spec/units/rabbit_spec.rb

+12
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,18 @@
104104
describe "#read_queue" do
105105
specify { expect(Rabbit.config.read_queue).to eq("test_group_id.test_project_id") }
106106

107+
context "with nil suffix provided" do
108+
before { Rabbit.config.queue_suffix = nil }
109+
110+
specify { expect(Rabbit.config.read_queue).to eq("test_group_id.test_project_id") }
111+
end
112+
113+
context "with blank suffix provided" do
114+
before { Rabbit.config.queue_suffix = "" }
115+
116+
specify { expect(Rabbit.config.read_queue).to eq("test_group_id.test_project_id") }
117+
end
118+
107119
context "with suffix provided" do
108120
before { Rabbit.config.queue_suffix = "smth" }
109121

0 commit comments

Comments
 (0)