pwwka 0.22.2.RC4 → 0.22.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pwwka/channel_connector.rb +30 -10
- data/lib/pwwka/send_message_async_sidekiq_job.rb +0 -1
- data/lib/pwwka/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1388132955d9c594eeeaa04a7d28cc0e7f496dd643ef126b5e48f97677a2b95c
|
4
|
+
data.tar.gz: fd9c2c8ec635b09f9834d2ad5436d686718d201f9c2f3340c845db54cf73e5ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa79d1ad17757b4e091c157d4d4f58be251c87779429d0ccab954f1ee44735769c102e0e421f3151a88665d42e156d293504f55091b18bd70c0fd8bcc535bff5
|
7
|
+
data.tar.gz: 9f5cef8900f0d9add15efa40bbbd23c45d2f41da39b5bd9f631194f6370c78828ac684448740aca3d3d9750bc004a09d12cd3ebc2f29392466aa5a6b630aa399
|
@@ -14,16 +14,27 @@ module Pwwka
|
|
14
14
|
@configuration = Pwwka.configuration
|
15
15
|
connection_options = {automatically_recover: false}.merge(configuration.options)
|
16
16
|
connection_options = {client_properties: {connection_name: connection_name}}.merge(connection_options) if connection_name
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
|
18
|
+
begin
|
19
|
+
@connection = Bunny.new(configuration.rabbit_mq_host, connection_options)
|
20
|
+
@connection.start
|
21
|
+
rescue => e
|
22
|
+
logf "ERROR Connecting to RabbitMQ", error: e
|
23
|
+
@connection.close if @connection
|
24
|
+
raise e
|
25
|
+
end
|
26
|
+
|
27
|
+
begin
|
28
|
+
@channel = @connection.create_channel
|
29
|
+
rescue => e
|
30
|
+
logf "ERROR Opening RabbitMQ channel", error: e
|
31
|
+
@connection.close if @connection
|
32
|
+
raise e
|
33
|
+
end
|
34
|
+
|
20
35
|
if prefetch
|
21
36
|
@channel.prefetch(prefetch.to_i)
|
22
37
|
end
|
23
|
-
rescue => e
|
24
|
-
logf "ERROR Connecting to RabbitMQ", error: e
|
25
|
-
@connection.close if @connection
|
26
|
-
raise e
|
27
38
|
end
|
28
39
|
|
29
40
|
def topic_exchange
|
@@ -67,9 +78,18 @@ module Pwwka
|
|
67
78
|
end
|
68
79
|
|
69
80
|
def connection_close
|
70
|
-
|
71
|
-
|
72
|
-
|
81
|
+
begin
|
82
|
+
channel.close
|
83
|
+
rescue => e
|
84
|
+
logf "ERROR Closing RabbitMQ channel", error: e
|
85
|
+
end
|
73
86
|
|
87
|
+
begin
|
88
|
+
connection.close
|
89
|
+
rescue => e
|
90
|
+
logf "ERROR Closing connection to RabbitMQ", error: e
|
91
|
+
raise e
|
92
|
+
end
|
93
|
+
end
|
74
94
|
end
|
75
95
|
end
|
data/lib/pwwka/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pwwka
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.22.2
|
4
|
+
version: 0.22.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stitch Fix Engineering
|
@@ -313,9 +313,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
313
313
|
version: '0'
|
314
314
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
315
315
|
requirements:
|
316
|
-
- - "
|
316
|
+
- - ">="
|
317
317
|
- !ruby/object:Gem::Version
|
318
|
-
version:
|
318
|
+
version: '0'
|
319
319
|
requirements: []
|
320
320
|
rubyforge_project:
|
321
321
|
rubygems_version: 2.7.6
|