pwwka 0.20.0 → 0.21.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/pwwka/configuration.rb +2 -0
- data/lib/pwwka/receiver.rb +1 -1
- data/lib/pwwka/transmitter.rb +1 -1
- data/lib/pwwka/version.rb +2 -1
- data/spec/spec_helper.rb +1 -0
- data/spec/unit/receiver_spec.rb +1 -1
- data/spec/unit/transmitter_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03c194e74867672309005716e99ae625198af4d62cc786597d69f512271167ef
|
4
|
+
data.tar.gz: 7393fe11c6fba435026b0f2a9d9e151ef0d661dd39d8d68aa863d0a6b2a78e04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75e2869b0502198ac7ce178de20a0b219e7c7e3c11ccda626ae9ab0383c0fcfe1903ea3101cb23885100e823f08449a4743b46152d172bc0237bb8e4283dff13
|
7
|
+
data.tar.gz: 87b050ce2821f2569bf1b9eaad59d691ecd9b6ded09a9e3dedd88e55a54a4e8d39d82f34b7b536c3cce3f9028ae1568757b4aa121639d771b14206aeb594f14f
|
data/README.md
CHANGED
data/lib/pwwka/configuration.rb
CHANGED
@@ -13,6 +13,7 @@ module Pwwka
|
|
13
13
|
attr_accessor :async_job_klass
|
14
14
|
attr_accessor :send_message_resque_backoff_strategy
|
15
15
|
attr_accessor :default_prefetch
|
16
|
+
attr_accessor :process_name
|
16
17
|
attr_reader :requeue_on_error
|
17
18
|
attr_writer :app_id
|
18
19
|
attr_writer :error_handling_chain
|
@@ -32,6 +33,7 @@ module Pwwka
|
|
32
33
|
@async_job_klass = Pwwka::SendMessageAsyncJob
|
33
34
|
@default_prefetch = nil
|
34
35
|
@receive_raw_payload = false
|
36
|
+
@process_name = $0
|
35
37
|
end
|
36
38
|
|
37
39
|
def keep_alive_on_handler_klass_exceptions?
|
data/lib/pwwka/receiver.rb
CHANGED
@@ -12,7 +12,7 @@ module Pwwka
|
|
12
12
|
def initialize(queue_name, routing_key, prefetch: Pwwka.configuration.default_prefetch)
|
13
13
|
@queue_name = queue_name
|
14
14
|
@routing_key = routing_key
|
15
|
-
@channel_connector = ChannelConnector.new(prefetch: prefetch, connection_name: "c: #{
|
15
|
+
@channel_connector = ChannelConnector.new(prefetch: prefetch, connection_name: "c: #{Pwwka.configuration.app_id} #{Pwwka.configuration.process_name}".strip)
|
16
16
|
@channel = @channel_connector.channel
|
17
17
|
@topic_exchange = @channel_connector.topic_exchange
|
18
18
|
end
|
data/lib/pwwka/transmitter.rb
CHANGED
@@ -26,7 +26,7 @@ module Pwwka
|
|
26
26
|
attr_reader :channel_connector
|
27
27
|
|
28
28
|
def initialize
|
29
|
-
@channel_connector = ChannelConnector.new(connection_name: "p: #{Pwwka.configuration.app_id}")
|
29
|
+
@channel_connector = ChannelConnector.new(connection_name: "p: #{Pwwka.configuration.app_id} #{Pwwka.configuration.process_name}".strip)
|
30
30
|
end
|
31
31
|
|
32
32
|
# Send an important message that must go through. This method allows any raised exception
|
data/lib/pwwka/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -35,6 +35,7 @@ RSpec.configure do |config|
|
|
35
35
|
c.requeue_on_error = false
|
36
36
|
c.rabbit_mq_host = "amqp://guest:guest@localhost:#{test_configuration.rabbit_port}"
|
37
37
|
c.app_id = "MyAwesomeApp"
|
38
|
+
c.process_name = "my_awesome_process"
|
38
39
|
|
39
40
|
unless ENV["SHOW_PWWKA_LOG"] == "true"
|
40
41
|
c.logger = MonoLogger.new("/dev/null")
|
data/spec/unit/receiver_spec.rb
CHANGED
@@ -26,7 +26,7 @@ describe Pwwka::Receiver do
|
|
26
26
|
|
27
27
|
it 'sets the correct connection_name' do
|
28
28
|
subject
|
29
|
-
expect(Pwwka::ChannelConnector).to have_received(:new).with(prefetch: nil, connection_name: "c:
|
29
|
+
expect(Pwwka::ChannelConnector).to have_received(:new).with(prefetch: nil, connection_name: "c: MyAwesomeApp my_awesome_process")
|
30
30
|
end
|
31
31
|
|
32
32
|
it 'closes the conenction on an error' do
|
@@ -20,7 +20,7 @@ describe Pwwka::Transmitter do
|
|
20
20
|
allow(logger).to receive(:info)
|
21
21
|
allow(logger).to receive(:warn)
|
22
22
|
allow(logger).to receive(:error)
|
23
|
-
allow(Pwwka::ChannelConnector).to receive(:new).with(connection_name: "p: MyAwesomeApp").and_return(channel_connector)
|
23
|
+
allow(Pwwka::ChannelConnector).to receive(:new).with(connection_name: "p: MyAwesomeApp my_awesome_process").and_return(channel_connector)
|
24
24
|
allow(channel_connector).to receive(:connection_close)
|
25
25
|
allow(topic_exchange).to receive(:publish)
|
26
26
|
allow(delayed_exchange).to receive(:publish)
|
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.
|
4
|
+
version: 0.21.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stitch Fix Engineering
|
@@ -15,7 +15,7 @@ authors:
|
|
15
15
|
autorequire:
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
|
-
date:
|
18
|
+
date: 2019-01-07 00:00:00.000000000 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: bunny
|